Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 2 Push button and Potentiometer

Similar presentations


Presentation on theme: "Chapter 2 Push button and Potentiometer"— Presentation transcript:

1 Chapter 2 Push button and Potentiometer

2 Table of Content Push Button Example 1 Potentiometer Example 2
Exercise 1 Challenge 1 Challenge 2

3 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

4 Example 1 control led with button
The button control the led

5 Potentiometer It’s a resistor You can change its value

6 Example 2 dime a light

7 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);

8 Challenge 1

9 Next Chapter Inputs and Outputs


Download ppt "Chapter 2 Push button and Potentiometer"

Similar presentations


Ads by Google