I have a competion coming up in two days and i cant figure out what im doing wrong. I have five flex sensors sewn into a glove going to a board. They are 10K flex sensors with a 10K pull down resistor set up in a voltage divider circuit. My servos pull six volts so i have a different power supply for them. The grounds are commen from the arduino to the power supply. None of my servos are working. This is my code.
#include <Servo.h>
Servo Claw;
Servo Wrist;
Servo Elbow;
Servo Shoulder;
Servo Base;
int PinClaw = 3;
int PinWrist = 5;
int PinElbow = 6;
int PinShoulder = 9;
int PinBase = 10;
void setup() {
Serial.begin(9600);
Claw.attach(PinClaw);
Wrist.attach(PinWrist);
Elbow.attach(PinElbow);
Shoulder.attach(PinShoulder);
Base.attach(PinBase);
}
void loop()
{
int FlexClaw = analogRead(A0);
int FlexWrist = analogRead(A1);
int FlexElbow = analogRead(A2);
int FlexShoulder = analogRead(A3);
int FlexBase = analogRead(A4);
Serial.println(“Start”);
Serial.println(FlexClaw);
Serial.println(FlexWrist);
Serial.println(FlexElbow);
Serial.println(FlexShoulder);
Serial.println(FlexBase);
Serial.println(“Stop”);
int AngleClaw = map(FlexClaw, 350, 520, 180, 0);
int AngleWrist = map(FlexWrist, 350, 420, 180, 0);
int AngleElbow = map(FlexElbow, 220 , 500, 120, 90);
int AngleShoulder = map(FlexShoulder, 300, 500, 0, 180);
int AngleBase = map(FlexBase, 320, 560, 180, 0);
Claw.write(FlexClaw);
Wrist.write(FlexWrist);
Elbow.write(FlexElbow);
Shoulder.write(FlexShoulder);
Base.write(FlexBase);
}
What am I doing wrong. Please respond quickly???