Hello,
I recently bought a new continuous rotation servo from ebay:
http://cgi.ebay.com/15KG-Spring-RC-SM-S4315R-360-degree-Servo-SpringRC-360-/140423438269?cmd=ViewItem&pt=Radio_Control_Parts_Accessories&hash=item20b1e39fbd#ht_1943wt_923
I'm having a problem with it however. Whenever I plug in the red/positive wire if I have the black already plugged in (or if I plug in the black wire if I already have the red wire plugged in), it makes the tx/rx leds flash on my arduino board, and if I have serial monitor up and running, I get these messages in my main Arduino window (the black area with red text):
Error inside Serial.serialEvent()
java.io.IOException: Bad file descriptor in nativeavailable
at gnu.io.RXTXPort.nativeavailable(Native Method)
at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532)
at processing.app.Serial.serialEvent(Serial.java:215)
at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732)
at gnu.io.RXTXPort.eventLoop(Native Method)
at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575)
(It just loops over and over)
Then, if I plug in my control wire to my arduino, it usually does nothing. If I keep unplugging it, and plugging it back in though, it will usually do something, but not what the code says usually. If I keep doing this, it seems to turn off randomly, change directions and speeds all randomly. I made a video of this and put it on YouTube:
(The first 1:30 seconds are of my working servo that I bought from Sparkfun, so you can skip to about there to see my new, ?bad? one)
I'm pretty sure I have everything plugged in correctly, because as you see in the video, I can get my other servo that I bought from Sparkfun to work just fine:
And if you click on the datasheet for it, you'll see that the new one I bought from eBay is almost exactly the same as the one from Sparkfun. (I bought the one from ebay because I need a lot more torque than the one from Sparkfun).
Oh, here's my code:
// Controlling a full rotational servo
// Attach red wire of servo to +5V on Arduino
// Attach black wire of servo to GND on Arduino
// Attach control wire of servo to pin 9 on Arduino
#include <Servo.h>
Servo myservo; // create servo object to control a servo
void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop()
{
//for (int i=1; i <= 3; i=i+1)
// {
// myservo.write(i);
//Serial.print("Running motor at: ");
//Serial.println(i, DEC);
// delay(1000);
// }
//myservo.writeMicroseconds(1500); //stay idle
myservo.writeMicroseconds(2500); //
Serial.print("Running motor at: ");
}
So I'm just wondering if I'm correct in thinking that the servo is bad, because I need to return it within 7 days. I just can't figure out how a servo can be bad in a way that causes my Arduino to act all weird like it does (flashing those tx/rx lights and giving the error messages).
Thanks.