control angle via button pushes one button increases angle. other decreases angle. both light led
TRANSCRIPT
![Page 1: Control Angle via Button Pushes One button increases angle. Other decreases angle. Both light LED](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e8a5503460f94b8eef1/html5/thumbnails/1.jpg)
5V0
22242628303234363840424446485052GND
5V0
23
29313335373941434547495153
PWM/DIGITALCOMMUNICATION
POWER ANALOG IN
DIG
ITA
L
A0
A1
A2
A3
A4
A5
A6
A7
A8
A9
A10
A11
A12
A13
A14
A15
14 15 16 17 18 19 20 21
TX
3
RX3
TX
2
RX2
TX
1
RX1
SC
A
SC
L
777
766
755
744
743
722
71T
X0
70R
X0
RS
T
3V3
5V0
GN
D
GN
D
VIN
27
GND
25
SERVO
85A
RE
84G
ND
8313
8212
8111
8010
799
788
GROUND POWER
SIGNAL
INCREASE
DECREASE
BUTTONPUSHED
Control Angle via Button PushesOne button increases angle.Other decreasesangle.Both light LED.
![Page 2: Control Angle via Button Pushes One button increases angle. Other decreases angle. Both light LED](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e8a5503460f94b8eef1/html5/thumbnails/2.jpg)
Servo Control Using Analog Signal
5V0
22242628303234363840424446485052GND
5V0
23
29313335373941434547495153
PWM/DIGITALCOMMUNICATION
POWER ANALOG IN
DIG
ITA
L
A0
A1
A2
A3
A4
A5
A6
A7
A8
A9
A10
A11
A12
A13
A14
A15
14 15 16 17 18 19 20 21
TX
3
RX3
TX
2
RX2
TX
1
RX1
SC
A
SC
L
777
766
755
744
743
722
71T
X0
70R
X0
RS
T
3V3
5V0
GN
D
GN
D
VIN
27
GND
25
SERVO
85A
RE
84G
ND
8313
8212
8111
8010
799
788
GROUND POWER
SIGNAL
POTENTIOMETER(variable resistor)
WIPER
Obtain “analog” inputusing analogRead().
![Page 3: Control Angle via Button Pushes One button increases angle. Other decreases angle. Both light LED](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e8a5503460f94b8eef1/html5/thumbnails/3.jpg)
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: RI = V / R
V = 5, R = 5, I = ?
![Page 4: Control Angle via Button Pushes One button increases angle. Other decreases angle. Both light LED](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e8a5503460f94b8eef1/html5/thumbnails/4.jpg)
5 V
R
?V
5 V
R
?V
What Is the Measured Voltage?
0V 5V
![Page 5: Control Angle via Button Pushes One button increases angle. Other decreases angle. Both light LED](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e8a5503460f94b8eef1/html5/thumbnails/5.jpg)
What Is the Measured Voltage?
5V
5 V
R
?V
5 V
R
?V
5V
![Page 6: Control Angle via Button Pushes One button increases angle. Other decreases angle. Both light LED](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e8a5503460f94b8eef1/html5/thumbnails/6.jpg)
What Is the Measured Voltage?5 V
R
?V
5 V
R
?V
0V 0V
![Page 7: Control Angle via Button Pushes One button increases angle. Other decreases angle. Both light LED](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e8a5503460f94b8eef1/html5/thumbnails/7.jpg)
What Is the Measured Voltage?5 V
R/2?V
R/2
5 V
R/2
R/2
?V
0V 5V
![Page 8: Control Angle via Button Pushes One button increases angle. Other decreases angle. Both light LED](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e8a5503460f94b8eef1/html5/thumbnails/8.jpg)
What Is the Measured Voltage?
5 V
R/2
R/2
?V
2.5V
![Page 9: Control Angle via Button Pushes One button increases angle. Other decreases angle. Both light LED](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e8a5503460f94b8eef1/html5/thumbnails/9.jpg)
What Is the Measure Voltage?
5 V
R/5
R/5?V
R/5
R/5
R/5
?V
?V
?V
?V
?V
0V1V2V3V4V5V
![Page 10: Control Angle via Button Pushes One button increases angle. Other decreases angle. Both light LED](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e8a5503460f94b8eef1/html5/thumbnails/10.jpg)
Potentiometer5 V
R?V
WIPER
• Voltage at wiper depends onposition along the resistor.
• Voltage varies between ground(0V) and the supplied voltage(5V in this case).
• Voltage various continuously(analog “signal”).
![Page 11: Control Angle via Button Pushes One button increases angle. Other decreases angle. Both light LED](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e8a5503460f94b8eef1/html5/thumbnails/11.jpg)
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() whatreturns by 5.68333 (1023 / 5.68333 = 180).
![Page 12: Control Angle via Button Pushes One button increases angle. Other decreases angle. Both light LED](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e8a5503460f94b8eef1/html5/thumbnails/12.jpg)
5V0
22242628303234363840424446485052GND
5V0
23
29313335373941434547495153
PWM/DIGITALCOMMUNICATION
POWER ANALOG IN
DIG
ITA
L
A0
A1
A2
A3
A4
A5
A6
A7
A8
A9
A10
A11
A12
A13
A14
A15
14 15 16 17 18 19 20 21
TX
3
RX3
TX
2
RX2
TX
1
RX1
SC
A
SC
L
777
766
755
744
743
722
71T
X0
70R
X0
RS
T
3V3
5V0
GN
D
GN
D
VIN
27
GND
25
SERVO
85A
RE
84G
ND
8313
8212
8111
8010
799
788
GROUND POWER
SIGNAL
INCREASE
DECREASE
BUTTONPUSHED
Control Angle via Button PushesOne button increases angle.Other decreasesangle.Both light LED.