1
#include <Servo.h> 

const int x =  200 

//Naming the servosServo 
Servo servo1;
Servo servo2;
Servo servo3;
Servo servo4;
Servo servo5;
Servo servo6;

void setup() 
{ 
  Serial.begin(9600); 
  servo2.attach(10);
  servo3.attach(11); 
  servo4.attach(3); 
  servo5.attach(6); 
  servo6.attach(5); 
} 


void loop() 
{ 
  //Printing the EMG data
  Serial.println(analogRead(0)); 

  if (analogRead(5) > 200)
  {
    servo2.write(180);
    servo3.write(148);
    servo4.write(89);
    servo5.write(180);
    servo6.write(180);
  } else if (analogRead(0) < 200)
  {
    servo2.write(38);
    servo3.write(10);
    servo4.write(0);
    servo5.write(16);
    servo6.write(16);
  }

  delay(100);
} 
  • I don't know if the problem is in the code or in the circuit.
3
  • En este web site se habla inglés. ¿Puedes editar tu pregunta y traducirla al inglés? – Edgar Bonet Nov 28 '20 at 18:04
  • I'm assuming you're referring to this? – Mast Nov 28 '20 at 18:37
  • 1
    you said nothing about a problem that you are seeing ... remove all of the servo code ... reduce your code to read sensor and print the value to serial monitor – jsotola Nov 28 '20 at 18:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.