I'm trying controlling the 5 servo snd Flex sensor. So, I connect the Arduino with Bled Board(Flex sensor and 5 servo).
However, though I bended these Flex sensors, they are not reacted.
that code is below.
// letsarduino.com
// [Project 15] - 5 Flex/Bend Sensor + 5 Servo Motor + Arduino
#include <Servo.h>
Servo servoMotor1;
Servo servoMotor2;
Servo servoMotor3;
Servo servoMotor4;
Servo servoMotor5;
int servoPin1 = 2;
int servoPin2 = 3;
int servoPin3 = 4;
int servoPin4 = 5;
int servoPin5 = 6;
void setup() {
servoMotor1.attach(servoPin1);
servoMotor2.attach(servoPin2);
servoMotor3.attach(servoPin3);
servoMotor4.attach(servoPin4);
servoMotor5.attach(servoPin5);
}
void loop()
{
int analogValue = analogRead(A0);
int servoAngle = map(analogValue, 550, 640, 0, 179);
servoMotor1.write(servoAngle);
int analogValue2 = analogRead(A1);
int servoAngle2 = map(analogValue2, 550, 640, 0, 179);
servoMotor2.write(servoAngle2);
int analogValue3 = analogRead(A2);
int servoAngle3 = map(analogValue3, 550, 640, 0, 179);
servoMotor3.write(servoAngle3);
int analogValue4 = analogRead(A3);
int servoAngle4 = map(analogValue4, 550, 640, 0, 179);
servoMotor4.write(servoAngle4);
int analogValue5 = analogRead(A4);
int servoAngle5 = map(analogValue5, 550, 640, 0, 179);
servoMotor5.write(servoAngle5);
}
Do you know why these flex sensors and servo motors are not reacted? I think Wiring between bred board and arduino, flex sensors and servo motors are not mistaken.