Hey everyone! I've an idea, i uploaded video with two codes. - YouTube
These two codes are different than I uploaded in this forum, and just look how it works with this two codes --->
GLOVE:
int Finger1 = 1;
int Finger2 = 2;
int Finger3 = 3;
int Finger4 = 3;
int Finger5 = 5;
void setup()
{
Serial.begin(9600);
}
void loop()
{
byte servoValue1;
byte servoValue2;
byte servoValue3;
byte servoValue4;
byte servoValue5;
int FingerV1 = analogRead(Finger1);
int FingerV2 = analogRead(Finger2);
int FingerV3 = analogRead(Finger3);
int FingerV4 = analogRead(Finger4);
int FingerV5 = analogRead(Finger5);
byte servoVal1 = map(FingerV1,0, 1023, 0, 179);
byte servoVal2 = map(FingerV2,0, 1023, 0, 179);
byte servoVal3 = map(FingerV3,0, 1023, 0, 179);
byte servoVal4 = map(FingerV4,0, 1023, 0, 179);
byte servoVal5 = map(FingerV5,0, 1023, 0, 179);
Serial.println(servoVal1);
Serial.println(servoVal2);
Serial.println(servoVal3);
Serial.println(servoVal4);
Serial.println(servoVal5);
delay(1000);
}
AND HAND:
#include <Servo.h>
Servo myservo1; // create servo object to control a servo
Servo myservo2;
Servo myservo3;
Servo myservo4;
Servo myservo5;
void setup()
{
Serial.begin(9600);
myservo1.attach(11); // attaches the servo on pin 9 to the servo object
myservo2.attach(10);
myservo3.attach(9);
myservo4.attach(6);
myservo5.attach(5);
}
void loop()
{
if(Serial.available() >=5)
{
byte servoVal1 = Serial.read();
byte servoVal2 = Serial.read();
byte servoVal3 = Serial.read();
byte servoVal4 = Serial.read();
byte servoVal5 = Serial.read();
// Send the servo to the position read... (note: you get to make this happen)
myservo1.write(servoVal1);
myservo2.write(servoVal2);
myservo3.write(servoVal3);
myservo4.write(servoVal4);
myservo5.write(servoVal5);
}
}
all i want to do like this
but why its not working for me?
it's can be problem that i use LDR? not a flex sensors?