Im having trouble with most of the servo codes i have. they dont seem to be doing what they are sposed to..
my mini servos do not respond to any of them, and my futaba S3003 taken to their extent and the program just keeps trying to push them beyond that instead of making it go back and forth like the program says..
the code in question:
/*
* Servo Move Simple
* -----------------
* Move an R/C servo back and forth (0 to 180 degrees) using
* delayMicroseconds() for pulse and delay() for time between pulses.
*
* Created 18 October 2006
* copyleft 2006 Tod E. Kurt <tod@todbot.com>
* http://todbot.com/
*
* Adapted from Daniel @
* http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1160470155/0
* Rotates servo through 180 degrees, using "servoPulse" function
* adapted from "Temporary Servo Function" by Tom Igoe and Jeff Gray
*/
int servoPin = 7; // R/C Servo connected to digital pin
int myAngle; // angle of the servo (roughly in degrees) 0-180
int pulseWidth; // function variable
void servoPulse(int servoPin, int myAngle) {
pulseWidth = (myAngle * 9) + 700; // converts angle to microseconds
digitalWrite(servoPin, HIGH); // set servo high
delayMicroseconds(pulseWidth); // wait a very small amount
digitalWrite(servoPin, LOW); // set servo low
Serial.print("pulseWidth: "); Serial.println(pulseWidth);
delay(20); // refresh cycle of typical servos (20 ms)
}
void setup() {
pinMode(servoPin, OUTPUT); // set servoPin pin as output
Serial.begin(19200);
}
void loop() {
// cycle through every angle (rotate the servo 180 slowly)
for (myAngle=0; myAngle<=180; myAngle++) {
servoPulse(servoPin, myAngle);
}
delay(1000);
}
as soon as it is uploaded to the Arduino it moves the servo to max position (clockwise 100%) and tries to push it further. it doesn't move in the other direction at all. why is it doing this?
My mini servos do not seem to do anything when they are connected. they are E_Sky micro servos 8g
Both servo types work perfectly in the radio kit i have (Futaba R114F Rx, and Futaba Skysport ss3 Tx) without problems.
It seems that they do not like runing i\under usb power and only cooperate on battery :S
are your servos powered from the +9v pin or +5v pin on your arduino? the 9v pin only carries power when you're using an external power-source (not USB).
It seems that they do not like runing i\under usb power and only cooperate on battery :S
are your servos powered from the +9v pin or +5v pin on your arduino? the 9v pin only carries power when you're using an external power-source (not USB).
The 5V pin naturally ( i don't see a 9V pin, what one is that?)
If I am correct, servo's are normally powered by 4-6V, so you might destroy it at 9V.
If your servo's don't work, then they are probably drawing too much current, at least more than Arduino can provide. In this case, use an external power supply to power the servo's and just use the Arduino for the signal.
The 9V pin is the 2nd (from left to right) orange colored pin at the bottom of the image below.
that 9v pin is a Vin on my board this is the power bit of it (Reset, 3v3, +5V Gnd, Gnd, Vin)
so the usb isnt enough to drive it? also im getting the rx and tx lights on low wen its on battery power, they just sit there slightly on (in all sketches) but they remain off on USB power (unles being used)
The pin marked Vin (next to the Gnd pin) is the 9 volt input pin. But as pointed out above, this is too much for most servos.
yea it would be a bit too much.. i need to sort my joystick pots out with new wires so i can make a x and y control axis need to make a trip to the components shop too for some resistors and such
One of the Deicemila changes was to add two additional pins to the "power" connector; 3.3V and RESET, to the LEFT of existing power pins. So a shield that is "only" NG-aware still works attached to a diecemila, it just doesn't have connections to the two new power pins...