Chapter 2 Push button and Potentiometer
Table of Content Push Button Example 1 Potentiometer Example 2 Exercise 1 Challenge 1 Challenge 2
Push button Button is a switch (on/off) When the button if off, the current flow is stop When the button is on the flow start. Push button help us control manually the circuit
Example 1 control led with button The button control the led
Potentiometer It’s a resistor You can change its value
Example 2 dime a light
Challenge 1 Use a potentiometer to change which LED is turn on. Plug the left pin in the 5Volts output and the right pin in the ground (GND). The middle pin must be plug in an analog output (A0). To read the value of the potentiometer use: Int resistor = A0; Int readValue = 0; readValue = analog.read(pinA0) readValue = map(readValue, 0, 1023, 0, 255);
Challenge 1
Next Chapter Inputs and Outputs