Squirrels have fuzzy tails.
0 Members and 1 Guest are viewing this topic.
for(pos=0;pos<180;pos+=1) { myservo.write(pos); delay(15); } for(pos=180;pos>=1;pos-=1) { myservo.write(pos); delay(15);
Note servos draw considerable power, so if you need to drive more than one or two, you'll probably need to power them from a separate supply (i.e. not the +5V pin on your Arduino). Be sure to connect the grounds of the Arduino and external power supply together.
I did not connect the external power supplys negative lead to the arduinos ground...but I don't really understand why this is necessary.
Actually, does any one know if the grounds really need to be connected?
I'm sorry for the necromancy, but I still have a few more questions and/or clarifications.First of all, I didn't just hook up one side of the battery, I never said that. I said I didn't hook it up to the arduino ground; I hooked it up to the servos black(grd) lead. It was my understanding from chemistry that the electrons joined combined with the other metal in the battery, and that the chemical reaction is what drove the electrons down the wire(at least in photovoltaic cells). I am pretty rookie but i'm not totally a greenback, I have taken digital logic, microP, etc. So why then do I need to ground the battery? I still don't understand, and I don't want to blow another servo. Thank you very much for your time and patience.
I'm sorry for the necromancy, but I still have a few more questions and/or clarifications.First of all, I didn't just hook up one side of the battery, I never said that. I said I didn't hook it up to the arduino ground;
Wouldn't the "return path" be the negative lead of the battery?
Also, I did open it up, the wires were melted together and to the circuit board, but the gears were fine.
Voltage is the potential energy per unit charge.As we all know, there is no universal point where there is 0 potential energy. When we talk about energy, it's all relative. In terms of gravitational potential energy, for example, can you tell me my altitude if I just tell you I have 10J of gravitational potential energy? No, because that depends on my reference - 10J more potential energy compared to where?In physics we "define" 0 to be at infinity. Here we define it to be the negative terminal of the battery. The positive terminal is 9V more positive than the negative terminal. That's all the "9V" rating tells you.1 unit charge at the positive terminal have, 9J higher potential energy than those at the negative terminal.Your servo has 3 lines - 0V, 5V, and 6V.You connected the ground of 5V supply to 0V, and 5V to 5V. All is good. The 5V line is 5V higher than the ground line, and that's all the servo cares about.Now, you are adding in another battery, and connecting the positive terminal to 6V. 6V compared to what? The servo 6V line will be 6V higher than the negative terminal of the second battery. That doesn't tell you anything. It can be at any voltage. It can be 1000V, while the negative terminal of the battery is at 994V (compared to the ground of the first battery). Or -1000V and -1006V. The second battery doesn't care. It's maintaining the 6V difference.In practice, since no current can flow, it will be as if it's not connected at all. The positive terminal of the 6V battery will take whatever voltage the "6V line" happens to be at, and the negative terminal will be 6V below that.How do you make sure it's 6V above the ground of the first battery? You connect the 2 grounds.