|Copyright||(c) Levent Erkok|
Demonstrates basic Servo motor control
Control a servo, by executing user requests of blade movement. We allow 3 user commands:
lto swipe from angle-0 to 180;
rto swipe from angle-180 to 0;
- Or any number between
180, which puts the servo to the desired position.
Almost any servo motor would work with this example, though you should make sure to adjust min/max pulse durations
attach command to match the datasheet of the servo you have. In this example, we have used the HS-55 feather
servo (http://www.servocity.com/html/hs-55_sub-micro.html), which has the values 600 to 2400 micro-seconds.
To connect the servo to the Arduino, simply connect the VCC (red) and the GND (black) appropriately, and the signal line (white) to any SERVO capable pin, in this example we're using pin number 9:
Control a servo, as guided by the input read from a potentiometer. The set-up is similar to the
above, except instead of querying the user for the angle, we use the readings from a potentiometer connected to
analog input number 2. We used a 10 KOhm potentiometer, but other pots would work just as well too: