Assignment 1

1. Read a momentary switch being pressed
2. When the program starts, both LEDs are off
3. When the switch is pressed once, the first LED turns on
4. When the switch is pressed the second time, the second LED turns on (the first one should also still be on)
5. When the switch is pressed the third time, both LEDs turn off
6. Repeat this same cycle of LEDs turning on and off in sequence (off, one LED, two LEDs, off…)
Code image:

 

How does it actually work: https: https://youtu.be/d4hS2_jnsLw

 

Leave a Reply

Your email address will not be published. Required fields are marked *