int sensorPin = A7; // select the input pin for the signal from the TL084 int muscle_value; void setup() { // Start the hardware serial. Serial.begin(9600); pinMode(2, OUTPUT); pinMode(3, OUTPUT); pinMode(4, OUTPUT); pinMode(5, OUTPUT); pinMode(6, OUTPUT); } void loop() { muscle_value = analogRead(sensorPin); Serial.print("muscle = "); Serial.println(muscle_value); muscle_value = map(muscle_value,0,1024,0,100); if ((muscle_value >= 0) && (muscle_value < 10)) { digitalWrite(2, HIGH); digitalWrite(3, LOW); digitalWrite(4, LOW); digitalWrite(5, LOW); digitalWrite(6, LOW); } if ((muscle_value >= 10) && (muscle_value < 20)) { digitalWrite(2, LOW); digitalWrite(3, HIGH); digitalWrite(4, LOW); digitalWrite(5, LOW); digitalWrite(6, LOW); } if ((muscle_value >= 20) && (muscle_value < 30)) { digitalWrite(2, LOW); digitalWrite(3, LOW); digitalWrite(4, HIGH); digitalWrite(5, LOW); digitalWrite(6, LOW); } if ((muscle_value >= 30) && (muscle_value < 40)) { digitalWrite(2, LOW); digitalWrite(3, LOW); digitalWrite(4, LOW); digitalWrite(5, HIGH); digitalWrite(6, LOW); } if (muscle_value >= 40) { digitalWrite(2, LOW); digitalWrite(3, LOW); digitalWrite(4, LOW); digitalWrite(5, LOW); digitalWrite(6, HIGH); } }