Presentation is loading. Please wait.

Presentation is loading. Please wait.

Servo Demonstration In MPIDE, select File > Examples > Servo > Sweep.

Similar presentations


Presentation on theme: "Servo Demonstration In MPIDE, select File > Examples > Servo > Sweep."— Presentation transcript:

1 Servo Demonstration In MPIDE, select File > Examples > Servo > Sweep

2 Increase Angle via Button Push If button pushed, increase position/angle by 1. If angle greater than 180, reset to 0.

3 Increase Angle via Button Push If button pushed, increase angle and light LED.

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

5 Display Angle in Serial Monitor Must initialize serial line in setup() function: Serial.begin(9600); Must “print a line” in the loop() function: Serial.println(pos, DEC); Must open the “Serial Monitor”:

6 Servo Control using Analog Signal Obtain “analog” input using analogRead(). Returns value a value between 0 (if pin at ground) and 1023 (if pin at 3.3 V). Voltage at “wiper” can vary between voltages at either end of the potentiometer.


Download ppt "Servo Demonstration In MPIDE, select File > Examples > Servo > Sweep."

Similar presentations


Ads by Google