Questions
- Why do we place a resistor between an LED anode and the GPIO port?
- How do we stop a signal from floating?
- Why do we sleep after checking a button's state?
- How would you modify the code to achieve the following behavior?
a. When the button is pressed, turn off the red and green LEDs of the traffic lights and let the yellow LED blink.
b. When the button is pressed again: go back to the normal phase rotation.