[quote]val = map(val, 0, 1023, 0, 179);
[/quote]
ok i have that all firgured out because it really depends how i have my servos positions and i no those numbers i have dont make a hole lata sense but they work
Now the only problm i have is getting a xbee...
as you no on my other posts i have a budget and need two xbees and two shields or a way to put them hook them up to the arduino
any help would do
By the way this is my new code i made that eearlier one in about a couple seconds but heres the one i got working:
#include <Servo.h>
Servo myservo1;
Servo myservo2;
Servo myservo3;
Servo myservo4;
Servo myservo5;
int Flexsensor0= 1;
int Flexsensor1=2;
int Flexsensor2=3;
int Flexsensor3=4;
int Flexsensor4 =5;
int val;
void setup()
{
myservo1.attach(2);
myservo2.attach(3);
myservo3.attach(4);
myservo4.attach(5);
myservo5.attach(6); //
}
void loop()
{{{{{
val = analogRead(Flexsensor0);
val = map(val, 500, 0, 500, 4000);
myservo1.write(val);
delay(15);
}
val = analogRead(Flexsensor1);
val = map(val, 500, 0, 500, 4000);
myservo2.write(val);
delay(15);
}
val = analogRead(Flexsensor2);
val = map(val, 500, 0, 500, 4000);
myservo3.write(val);
delay(15);
}
val = analogRead(Flexsensor3);
val = map(val, 500, 0, 500, 4000);
myservo4.write(val);
delay(15);
}
val = analogRead(Flexsensor4);
val = map(val, 500, 0, 500, 4000);
myservo5.write(val);
delay(15);
}
now another thing is still the sending code now i have hopfully evething here for the sending code but not iin the sending format:
void loop()
{{{{{
val = analogRead(Flexsensor0);
val = map(val, 500, 0, 500, 4000);
myservo1.write(val);
delay(15);
}
val = analogRead(Flexsensor1);
val = map(val, 500, 0, 500, 4000);
myservo2.write(val);
delay(15);
}
val = analogRead(Flexsensor2);
val = map(val, 500, 0, 500, 4000);
myservo3.write(val);
delay(15);
}
val = analogRead(Flexsensor3);
val = map(val, 500, 0, 500, 4000);
myservo4.write(val);
delay(15);
}
val = analogRead(Flexsensor4);
val = map(val, 500, 0, 500, 4000);
myservo5.write(val);
delay(15);
}
now if you could maybe help me by explaining how to send this is the right format it would be great