Go Down

Topic: Controlling two servos through serial (Read 5 times) previous topic - next topic

n00b234

#5
May 28, 2009, 08:47 am Last Edit: May 28, 2009, 08:48 am by thenewdoctorwho Reason: 1
should i be? im just powering them off the arduino board. whats the voltage on servos anyway, because i dont really have any available power supplies. is it just like 1.5V, so i could just put on a AA?

AWOL

No, it's more like 5 or 6V (4 x AA).

Code: [Select]
 if (Serial.available() > 0) {
   // read the incoming byte:
   moveServo1 = Serial.read();
   moveServo2 = Serial.read();

I wouldn't count on this always working.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

n00b234

what could i replace this with? im not a coder yet, i just combined a couple of code examples that didnt work for various reasons. im still just a noob. my mac hasnt told me that im consuming too much power from the servos, which it does if i do too much. but i could use my arduino power supply and my usb port. would that be ok?

AWOL

#8
May 28, 2009, 09:08 am Last Edit: May 28, 2009, 09:13 am by AWOL Reason: 1
http://arduino.cc/en/Serial/Read

How many times do you calculate "pulseWidth"?
How many times do you use it?  ;)
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

n00b234

Im not exactly sure what it even is, but i think that is used a lot. i posted all the code, so u can check for urself

Go Up