Devices & Components
Jumper wires (generic)
Hardware & Tools
Wire Welder
Project description
Code
Code
arduino
The sensor values that you find in the code may be different for every project, depending on the servoMotors and on the position of the sensors. So you may need to change some values in order to make the servoMotors respond perfectly
1#include <Servo.h> 2Servo myservo_pollice; 3Servo myservo_indice; 4 5Servo myservo_medio; 6Servo myservo_anulare; 7Servo myservo_mignolo; 8 9int 10 pollice; 11int indice; 12int medio; 13int anulare; 14int mignolo; 15 16 17void 18 setup() { 19 Serial.begin(9600); 20 myservo_pollice.attach(9); 21 myservo_indice.attach(10); 22 23 myservo_medio.attach(11); 24 myservo_anulare.attach(12); 25 myservo_mignolo.attach(13); 26} 27 28 29void 30 loop() { 31 pollice = analogRead(A4); 32 indice = analogRead(A3); 33 medio 34 = analogRead(A2); 35 anulare = analogRead(A1); 36 mignolo = analogRead(A0); 37 38 39 Serial.println(mignolo); 40 41 pollice = map(pollice, 90, 10, 0, 99); 42 43 indice = map(indice, 20, 40, 159, 40); 44 medio = map(medio, 20, 40, 159, 45 40); 46 // anulare = map(anulare, 20, 40, 0, 179); 47 mignolo = map(mignolo, 48 20, 40, 159, 40); 49 50 myservo_pollice.write(pollice); 51 myservo_indice.write(indice); 52 53 myservo_medio.write(medio); 54 myservo_anulare.write(anulare); 55 myservo_mignolo.write(mignolo); 56 57 58 delay(150); 59} 60
Code
arduino
The sensor values that you find in the code may be different for every project, depending on the servoMotors and on the position of the sensors. So you may need to change some values in order to make the servoMotors respond perfectly
1#include <Servo.h> 2Servo myservo_pollice; 3Servo myservo_indice; 4Servo myservo_medio; 5Servo myservo_anulare; 6Servo myservo_mignolo; 7 8int pollice; 9int indice; 10int medio; 11int anulare; 12int mignolo; 13 14 15void setup() { 16 Serial.begin(9600); 17 myservo_pollice.attach(9); 18 myservo_indice.attach(10); 19 myservo_medio.attach(11); 20 myservo_anulare.attach(12); 21 myservo_mignolo.attach(13); 22} 23 24 25void loop() { 26 pollice = analogRead(A4); 27 indice = analogRead(A3); 28 medio = analogRead(A2); 29 anulare = analogRead(A1); 30 mignolo = analogRead(A0); 31 32 Serial.println(mignolo); 33 34 pollice = map(pollice, 90, 10, 0, 99); 35 indice = map(indice, 20, 40, 159, 40); 36 medio = map(medio, 20, 40, 159, 40); 37 // anulare = map(anulare, 20, 40, 0, 179); 38 mignolo = map(mignolo, 20, 40, 159, 40); 39 40 myservo_pollice.write(pollice); 41 myservo_indice.write(indice); 42 myservo_medio.write(medio); 43 myservo_anulare.write(anulare); 44 myservo_mignolo.write(mignolo); 45 46 delay(150); 47} 48
Downloadable files
ServoMotor Scheme
How a seervomotor is connected to the microcontroller
ServoMotor Scheme

Flex-Sensor Scheme
How the sensors are connected to the microcontroller
Flex-Sensor Scheme

Circuit
All the circuits
Circuit

ServoMotor Scheme
How a seervomotor is connected to the microcontroller
ServoMotor Scheme

Flex-Sensor Scheme
How the sensors are connected to the microcontroller
Flex-Sensor Scheme

Sketch
A sketch that shows all the circuit using also a breadboard
Sketch

Circuit
All the circuits
Circuit

Comments
Only logged in users can leave comments