Uploaded by JoelUberTuber on Aug 6, 2011
This was very easy to connect and program. Hardware includes:
1) Arduino Uno board
2) Yourduino Sensor Shield expansion board
3) Three servos from different vendors: A high quality Futaba, one from Electronix Express, and one from Solarbotics
The servos plug directly into the Sensor shield board, which is nice.
The program was very easy to write. I'll include it here for those curious, with the disclaimer that it has room for cleanup. Especially note that YouTube would not allow greater than or less than symbols, so I've replaced them with tilde and double-tilde, respectively. You'll need to change them back before this program will run:
/*
Servo Test Program
Sweeps 3 different servos back and forth at the same time. This example code is based on stuff already in the public domain. Servo is attached to pins 3, 5, and 6. Servo connector follows digital I/O pinout on sensor shield: Black or brown = Ground Red = +5 VDC White, yellow, or orange = Signal
*/
#include ~Servo.h~~
Servo myservo3; // create servo objects to control servo s
Servo myservo5;
Servo myservo6;
int ServoPosition3 = 0;
int ServoPosition5 = 0;
int ServoPosition6 = 0;
void PrintPosition() {
Serial.print("Motor position is: ");
Serial.print(ServoPosition3); Serial.println(" degrees.");
}
void setup() { myservo3.attach(3); // attaches the servo on pin 3 to the servo object
myservo5.attach(5); // attaches the servo on pin 5 to the servo object
myservo6.attach(6); // attaches the servo on pin 6 to the servo object // start serial port at 9600 bps:
Serial.begin(9600);
}
void loop() {
ServoPosition5 = 185 - ServoPosition3;
ServoPosition6 = ServoPosition3;
myservo3.write(ServoPosition3); // tell servo to go to position in variable 'ServoPosition'
myservo5.write(ServoPosition5);
myservo6.write(ServoPosition6); PrintPosition();
delay(4); // wait for servo to move
if(ServoPosition3 == 0) { delay(1000); // wait for servo to move if moving 180 degrees
}
ServoPosition3 = ServoPosition3 + 7; // send servo to next position
if(ServoPosition3 ~~ 185) { // reset position if max. rotation reached ServoPosition3 = 0; delay(1000); // pause to let sero return
}
}
-
0 likes, 0 dislikes
0:30
My Arduino Uno Hexapod - Part 1by brenomansur515 views
0:29
Arduino UNO control two servo (MG945)by b038677166 views
1:03
Arduino Uno Servo robotby oldchurchst514 views
1:38
TLC5940 and 12 Servosby VexedPhoenix1,577 views
9:38
How-To Tuesday: Arduino 101 potentiometers and servosby makemagazine292,831 views
7:29
Using Arduino xbox type shield to control a Servo Motor!by saunixcomp1,890 views
1:48
.:A Single Servo:. - (Servos) - CIRC04by stuartmcfarlan3,899 views
0:08
Relay Board with Arduino Unoby HamRadio200810,017 views
2:38
Solar Tracker - Arduino Uno Motor Shieldby 08EvanG6,902 views
1:11
Interactive LED chase effect using Arduino UNOby djfoo000893 views
8:24
EEVblog #15 Part 2 of 2 - Fluke 189/289 multimeter reviewby EEVblog12,108 views
0:15
Arduino Robotic Armby gekkotwo9,245 views
5:55
Very Simple PWM MOSFET Demo with 3 H.P. DC Motorby JoelUberTuber353 views
5:30
Installing Arduino Software and UNO on Windows 7by hobbytronics1015,458 views
5:15
Arduino Robot Nino Alphaby soft92micro11,296 views
0:28
Self leveling surface with arduinoby k1vimaki3,224 views
1:29
Arduino Uno Board setup to control a servo directionby Pfowler7459 views
0:29
Arduino - Button Command Servo - Sampleby matteoxonox1,021 views
6:17
Tutorial - Use an Arduino to control a Servo motor!by saunixcomp18,000 views
0:40
Arduino Projects - Arduino Servo Basicby arduinoproject242 views
- Loading more suggestions...
Link to this comment:
All Comments (0)