loading

[code]

#include // servo kütüphanesi eklendi. bu önemi
const int isaret_parmak = A0;//işaret parmağının datası A0 pininden okuncak. const int orta_parmak = A1; //orta " " A1 " " const int yuzuk_parmak = A2; //yüzük " " A2 " " const int serce_parmak = A3; //serçe " " A3 " " Servo isaret;// her parmak için servoların isimleri belirtildi. Servo orta; Servo yuzuk;

Servo serce;

void setup() {

isaret.attach(2);//servoların takılacağı pinler attach komutu ile belirleniyor.

orta.attach(3);

yuzuk.attach(4);

serce.attach(5);

pinMode(isaret_parmak,INPUT_PULLUP);

pinMode(orta_parmak,INPUT_PULLUP);

pinMode(yuzuk_parmak,INPUT_PULLUP);

pinMode(serce_parmak,INPUT_PULLUP);

//Serial.begin(9600);

}

void loop() {

int deger0 = analogRead(isaret_parmak);

int deger1 = analogRead(orta_parmak);

int deger2 = analogRead(yuzuk_parmak);

int deger3 = analogRead(serce_parmak);

int new_deger0=map(deger0,640,740,0,180);

int new_deger1=map(deger1,315,550,0,180);

int new_deger2=map(deger2,300,440,0,180);

int new_deger3=map(deger3,515,555,0,180);

int yeni_deger0=constrain(new_deger0,8,175);

int yeni_deger1=constrain(new_deger1,8,175);

int yeni_deger2=constrain(new_deger2,8,175);

int yeni_deger3=constrain(new_deger3,8,175);

isaret.write(yeni_deger0);

orta.write(yeni_deger1);

yuzuk.write(yeni_deger2);

serce.write(yeni_deger3);

/* Serial.print("pot1: ");

Serial.print(deger0);

Serial.print(" pot2: ");

Serial.print(deger1);

Serial.print(" pot3: ");

Serial.print(deger2);

Serial.print(" pot4: ");

Serial.println(deger3); */

delay(10);

}

<p>what things did you used to make it</p>
<p>Great animatronic hand</p>

About This Instructable

1,329views

26favorites

License:

More by trkmn017:robot hand 
Add instructable to: