Presentation is loading. Please wait.

Presentation is loading. Please wait.

Control Angle via Button Pushes One button increases angle. Other decreases angle. Both light LED.

Similar presentations


Presentation on theme: "Control Angle via Button Pushes One button increases angle. Other decreases angle. Both light LED."— Presentation transcript:

1 Control Angle via Button Pushes One button increases angle. Other decreases angle. Both light LED.

2 Servo Control Using Analog Signal Obtain “analog” input using analogRead().

3 Voltage, V Voltage tells us how hard a positive charge is pushed between two different points. Something, such as a battery, is needed to create a voltage. Current, I Current tells us the amount of charge flowing through something (similar to gallons per minute). Current must have a path through which to flow. Resistor: R I = V / R V = 5, R = 5, I = ?

4 What Is the Measured Voltage? 0V5V

5 What Is the Measured Voltage? 5V

6 What Is the Measured Voltage? 0V

7 What Is the Measured Voltage? 0V5V

8 What Is the Measured Voltage? 2.5V

9 What Is the Measure Voltage? 0V 1V 2V 3V 4V 5V

10 Potentiometer WIPER Voltage at wiper depends on position along the resistor. Voltage varies between ground (0V) and the supplied voltage (5V in this case). Voltage various continuously (analog “signal”).

11 Conversion of Analog to Digital Obtain “analog” input using analogRead(). analogRead() returns a value between 0 (if pin at ground) and 1023 (if pin at 3.3 V). Argument of analogRead() is the pin to read (only pins labeled ANALOG IN can be used). Servo position varies between 0 and 180. Therefore, must divide analogRead() what returns by 5.68333 (1023 / 5.68333 = 180).

12 Control Angle via Button Pushes One button increases angle. Other decreases angle. Both light LED.


Download ppt "Control Angle via Button Pushes One button increases angle. Other decreases angle. Both light LED."

Similar presentations


Ads by Google