1. Goals

  • Learn about what happens when the Pico runs Python code. Text input, down to the CPU, and out to the hardware.

  • Take inventory of the capabilities of your hardware

  • Begin formulating your robot’s:

    • Mission objective

    • Constraints

    • Available resources

1.1. Objectives

  • Complete robot base.

  • Write your own script, from scratch, that operates ≥2 hardware things at once.

  • Have a mission concept that you and your team are excited about.

2. Agenda

2.1. Finish base hardware build

There will be plenty of time to add the LEGO top options. Our first focus is to ensure that everything else is constructed correctly.

2.2. Run the examples to test the hardware

FIRST STEP

Use the File Explorer to copy the folder of examples to your computer’s Documents folder.

Copy this folder: S: / COE / COEguest Shared / Robotics / beetlebot / 2. Python Tutorials / 2.Python_Codes

Everyone has access to the S: shared drive, so when anyone Saves a file (when you click Run), then it updates everyone else’s code also.

“Projects”:

  • 01 onboard LED

  • 02 ws6812 RGBs

  • 03 buzzer

  • 04 dot matrix display

  • 05 servo motion

  • 06 motors

  • 07.1 ultrasonic distance

  • 08 line following sensors

  • 09 read photoresistors values (test both sensors by modifying the code)

  • 10 IR remote and receiver

Several examples require uploading extra files to the Pico. These are libraries or packages that are imported or used in the main code.

  • It is useful to click STOP before uploading to ensure that the Pico isn’t busy.

  • Upload by right-clicking on the file in the upper pane and selecting “Upload to /”.

The file should now show up in the lower pane also. This lower location is the files that are physically on the Pico microcontroller. It appears like a (slow) flash drive when the Pico is idle.

2.3. Modify the examples

  • Ensure that you are using your personal copy of the example code.

Pick one of the smaller examples and slowly read the code.

  • What does each line seem to do?

  • What is next, then next, then next in the sequence of events?

  • What is the timing between actions? Change some of the time.sleep() numbers and run again to understand what they do.

Notice the numbers at the top of the code. Pin numbers are really important — they are the physical wires going out from the microcontroller.

2.4. Move your motors again

30 min. LOL

Refresh your memory about where your team left off yesterday. Complete the remaining steps.

Help other groups or get help from others.

2.5. What will be your team’s mission?

60 min total

You have a little familiarity with your robot platform and some of its capabilities and sensors and such.

Choose a technique or two.

Split up and do some thinking about:

  • What you want to accomplish this week for the epic robotics project thing.

    • then name it with a phrase. it must have a name

Code name generator

http://volta.valpo.edu:5000/5

2.6. Shuffle partners

Rotate partners for one time segment. This is a temporary swap.

Person with their own hardware starts:

  • Show off what you did yesterday. What went the smoothest (was it something you guessed would be so?)?

3. References