#include <Servo.h>;
Servo Servo1;
Servo Servo2;
Servo Servo3;
Servo Servo4;
int Potentio1 =A0;
int Potentio2 =A1;
int Potentio3 =A2;
int Potentio4 =A3;
void setup() {
// put your setup code here, to run once:
Servo1.attach(11);
Servo2.attach(9);
Servo3.attach(6);
Servo4.attach(3);
pinMode(Potentio1, INPUT);
pinMode(Potentio2, INPUT);
pinMode(Potentio3, INPUT);
pinMode(Potentio4, INPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
// Servo2.write(90);
// delay(1000);
// Servo2.write(0);
// delay(1000);
int VALUE1 = analogRead(Potentio1);
int VALUE2 = analogRead(Potentio2);
int VALUE3 = analogRead(Potentio3);
int VALUE4 = analogRead(Potentio4);
int ANGLE1 = map(VALUE1, 0, 1023, 0, 180);
int ANGLE2 = map(VALUE2, 0, 1023, 0, 180);
int ANGLE3 = map(VALUE3, 0, 1023, 0, 180);
int ANGLE4 = map(VALUE4, 0, 1023, 0, 180);
Servo1.write(ANGLE1);
Servo2.write(ANGLE2);
Servo3.write(ANGLE3);
Servo4.write(ANGLE4);
delay(150);
}