Yes, I got that values as the led approached the photoresistor, I've placed just a led and its respective ldr on one finger and I have got the same readings.
How are you going to make sure the LED on one finger does not affect the LDR on another as you move your fingers.
Well this something I hadn't thought about
#include <Servo.h>
Servo servo1;
int photores=A0;
int angulo=0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
servo1.attach(9);
}
void loop() {
// put your main code here, to run repeatedly:
{
if(photores==300)angulo+=45;
else if(photores<300)angulo=0;
angulo=(angulo,0,180);
servo1.write(0);
Serial.println(angulo);
delay(10);
}
{
if(photores==400)angulo+=45;
angulo=(angulo,0,180);
servo1.write(0);
Serial.println(angulo);
delay(10);
}
{
if(photores==500)angulo+=45;
angulo=(angulo,0,180);
servo1.write(0);
Serial.println(angulo);
delay(10);
}
{
if(photores==600)angulo+=45;
angulo=(angulo,0,180);
servo1.write(0);
Serial.println(angulo);
delay(10);
}
{
if(photores<=700)angulo+=45;
angulo=(angulo,0,180);
servo1.write(0);
Serial.println(angulo);
delay(10);
}
{
if(angulo=180&photores==600)angulo-=45;
photores=analogRead(A0);
Serial.println(photores);
angulo=(angulo,0,180);
servo1.write(0);
Serial.println(angulo);
delay(10);
}
{
if(angulo=135&photores==500)angulo-=45;
photores=analogRead(A0);
Serial.println(photores);
angulo=(angulo,0,180);
servo1.write(0);
Serial.println(angulo);
delay(10);
}
{
if(angulo=90&photores==400)angulo-=45;
photores=analogRead(A0);
Serial.println(photores);
angulo=(angulo,0,180);
servo1.write(0);
Serial.println(angulo);
delay(10);
}
{
if(angulo=45&photores==300)angulo-=45;
photores=analogRead(A0);
Serial.println(photores);
angulo=(angulo,0,180);
servo1.write(0);
Serial.println(angulo);
delay(10);
}
{
if(angulo<45&photores<300)angulo-=45;
photores=analogRead(A0);
Serial.println(photores);
angulo=(angulo,0,180);
servo1.write(0);
Serial.println(angulo);
delay(10);
}
}
I've made something like this but I'm not sure,one part is when the hand i being bended and the other is when the ahnd is being realesed
Also you will need a to look at how much power you need for the servos.
Thanks Tom