Arrch:
GeorgeBA13:
Bump anyone?Really? You're THAT impatient?
Hi again,
Yeah sorry about that I am running around being pretty busy at the moment and I thought I had left it about an hour and a half but it was only about 20 minutes!
PaulS:
Bump anyone?
You don't even have an Arduino. What is the rush?
Well I am only using 5 servos, one for each finger and one for the thumb.
And yet you need an int to count them? Really?
Are you saying that the Serial.print() won't work and I should replace them with Serial.byte()?
Where did I say that?
Serial.write() will send the byte-sized value as a single byte, that you can then read with one call.
Certainly not here.
When you say you don't see the point in the servo structure does that mean that it will not work? Or just that it can be made neater by using these functions?
The code should work, although clearly you'll need to test it, and adjust the limits until you get everything working exactly right, but there is a lot of unnecessary stuff going on.
Very true about that, please see my apology higher up in the post!
I though that I would use int as it is using numbers and as I use python quite a bit I always use ints. Is that a bad idea?
In your post here:
PaulS:
int iFinger;How many iFingers are you planning for the iGlove to have? How do you intend to deal with more than 255 servos, in terms of controlling or powering them?
if (servo[i].iFinger < ciDefault[0]) servo[i].iFinger = ciDefault[0];
else if (servo[i].iFinger > ciDefault[1]) servo[i].iFinger = ciDefault[1];
Perhaps you'd like to meet the [constrain()](http://arduino.cc/en/Reference/Constrain) function. No sense reinventing the wheel.Serial.print(servo[i].servoVal);
servo[i].servoAng = Serial.read();
Serial.print() will take a value like 200 and convert it to '2', '0', '0' and send those values to the serial port. You can not then read them all with one statement. Serial.write() will send the byte-sized value as a single byte, that you can then read with one call. Be sure to read and answer AWOL's question, too.
I thought that is what you meant.
Really I can probably live with a bit of unnecessary stuff for the first project! I'll do some other ones and then perfect this!
Thanks a lot for the help!