Servos misbehaving with arduino
September 2, 2012
First post here! Hello all.
I've built a robot (not my first) using 5g microservos, and I've just started playing around with the programming. I've got 8 servos connected to an Arduino Mega but I'm only working with 4 right now. These 4 servos are being powered through the 5v line on the arduino. I set up a simple code to have 4 stages of the motion of the robot. Each one has 4 servo position writes, one for each of the servo, then a delay of 1000, then it goes to the next stage. The problem is, once it gets to the 3rd step, it sets to those positions fine, but between the third step and the fourth step it doesn't do anything right. The servos set to seemingly random positions at 1 second intervals (even the ones that I haven't written to any values yet move!). They will set to these different positions anywhere from 1-3 times and then it goes to stage 4. Anyone know what could be going on here?