Self-check
- In this activity you:
- Added a third LED to your breadboard, and
- Used lists to customize some LED on/off sequences.
- Were you successfully able to create the third LED circuit?
- Do you understand how to use microbit.pin objects in a list?
- Can you accurately use the zip() function and modify the LED on/off sequences?
Questions
- What are two types of objects can you include in a list?
- Which function did you use to access two lists at the same time?
- Which statement accesses the pin to turn the LED on and off.
Exercises
- What type of information is in this list? location_list = [pin9, pin12, pin16]:
- What values turn the LEDs on and off?
- Describe what this line does: for time, temp in zip(time_list, temp_list):
- Create two short lists for names and scores then write a line of code that will match the name list with the score list.
Project
Create a script that turns the green on constantly for 10s, then flashes the yellow, and then finally ends with a solid red.
Solution.