Questions
- Answer: Use the sleep() function.
- Answer: Sequentially within loops.
Exercises
- Answer: change sleep(500) to sleep(100)
- Answer: write_analog() and write_digital()
- Answer: write_analog()
- Answer: while True
- Answer: Change the values in the pair of write_digital() statements for the lights from 0,0 and 1,1 to 1,0 and 0,1
- Answer: alternating and simultaneous
Project
Solution:
from microbit import*
pin13.write_digital(1)
while True:
pin14.write_digital(1)
sleep(500)
pin14.write_digital(0)
sleep(500)