Control Angle via Button Pushes
This presentation is the property of its rightful owner.
Sponsored Links
1 / 12

Control Angle via Button Pushes PowerPoint PPT Presentation


  • 55 Views
  • Uploaded on
  • Presentation posted in: General

Control Angle via Button Pushes. One button increases angle. Other decreases angle. Both light LED. Servo Control Using Analog Signal. Obtain “analog” input using analogRead () . Voltage, V. Voltage tells us how hard a positive charge is pushed between two different points.

Download Presentation

Control Angle via Button Pushes

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Control angle via button pushes

Control Angle via Button Pushes

One button increases angle.

Other decreasesangle.Both light LED.


Control angle via button pushes

Servo Control Using Analog Signal

Obtain “analog” input

using analogRead().


Control angle via button pushes

Voltage, V

  • Voltage tells us how hard a positive charge ispushedbetween two different points.

  • Something, such as a battery, is needed to createa voltage.

Current, I

  • Current tells us the amount of chargeflowing throughsomething (similar to gallons per minute).

  • Current must have a path through which to flow.

I = V / R

Resistor:

R

V = 5, R = 5, I = ?


Control angle via button pushes

What Is the Measured Voltage?

0V

5V


Control angle via button pushes

What Is the Measured Voltage?

5V

5V


Control angle via button pushes

What Is the Measured Voltage?

0V

0V


Control angle via button pushes

What Is the Measured Voltage?

0V

5V


Control angle via button pushes

What Is the Measured Voltage?

2.5V


Control angle via button pushes

What Is the Measure Voltage?

5V

4V

3V

2V

1V

0V


Control angle via button pushes

Potentiometer

  • 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”).

WIPER


Control angle via button pushes

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 ANALOGIN can be used).

  • Servo position varies between 0 and 180.Therefore, must divide analogRead()whatreturns by 5.68333 (1023 / 5.68333 = 180).


Control angle via button pushes

Control Angle via Button Pushes

One button increases angle.

Other decreasesangle.Both light LED.


  • Login