Understanding pushbuttons and pullup resistors
We controlled the brightness levels for red, green, and blue LEDs with a RESTful API. Then, we replaced the three LEDs with a single RGB LED and generated lights of different colors with the same RESTful API. Now, we want to make it possible for the users to change the brightness level for the three components with two pushbuttons added to the breadboard:
- A pushbutton to turn off all the colors, that is, to set all the colors to a brightness level equal to 0
- A pushbutton to set all the colors to their maximum brightness levels, that is, to set all the colors to a brightness level equal to 255
When the user presses the pushbutton, also known as a microswitch, it acts like a wire, and therefore, it lets the current flow through the circuit in which it is incorporated. When the pushbutton isn't pressed, the circuit in which it is incorporated is interrupted. Thus, whenever the user releases the pushbutton, the circuit is interrupted. Obviously...