This commit is contained in:
@@ -9,13 +9,13 @@
|
||||
|
||||
#include <Servo.h>
|
||||
|
||||
Servo myservo; // create servo object to control a servo
|
||||
Servo myservo; // create Servo object to control a servo
|
||||
|
||||
int potpin = A0; // analog pin used to connect the potentiometer
|
||||
int val; // variable to read the value from the analog pin
|
||||
|
||||
void setup() {
|
||||
myservo.attach(9); // attaches the servo on pin 9 to the servo object
|
||||
myservo.attach(9); // attaches the servo on pin 9 to the Servo object
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Knob
|
||||
|
||||
Control the position of a RC (hobby) [servo motor](http://en.wikipedia.org/wiki/Servo_motor#RC_servos) with your Arduino and a potentiometer.
|
||||
Control the position of an RC (hobby) [servo motor](http://en.wikipedia.org/wiki/Servo_motor#RC_servos) with your Arduino and a potentiometer.
|
||||
|
||||
This example makes use of the Arduino `Servo` library.
|
||||
|
||||
@@ -15,7 +15,7 @@ This example makes use of the Arduino `Servo` library.
|
||||
|
||||
Servo motors have three wires: power, ground, and signal. The power wire is typically red, and should be connected to the 5V pin on the Arduino board. The ground wire is typically black or brown and should be connected to a ground pin on the board. The signal pin is typically yellow or orange and should be connected to pin 9 on the board.
|
||||
|
||||
The potentiometer should be wired so that its two outer pins are connected to power (+5V) and ground, and its middle pin is connected to analog input 0 on the board.
|
||||
The potentiometer should be wired so that its two outer pins are connected to power (5V) and ground, and its middle pin is connected to analog input 0 on the board.
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
|
||||
#include <Servo.h>
|
||||
|
||||
Servo myservo; // create servo object to control a servo
|
||||
// twelve servo objects can be created on most boards
|
||||
Servo myservo; // create Servo object to control a servo
|
||||
// twelve Servo objects can be created on most boards
|
||||
|
||||
int pos = 0; // variable to store the servo position
|
||||
|
||||
void setup() {
|
||||
myservo.attach(9); // attaches the servo on pin 9 to the servo object
|
||||
myservo.attach(9); // attaches the servo on pin 9 to the Servo object
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Sweep
|
||||
|
||||
Sweeps the shaft of a RC [servo motor](http://en.wikipedia.org/wiki/Servo_motor#RC_servos) back and forth across 180 degrees.
|
||||
Sweeps the shaft of an RC [servo motor](http://en.wikipedia.org/wiki/Servo_motor#RC_servos) back and forth across 180 degrees.
|
||||
|
||||
## Hardware Required
|
||||
|
||||
|
||||
Reference in New Issue
Block a user