Paso 4: Control de 2 Servos con 2 potenciómetros.
this code makes it so when using the pots(potentiometers) the servos will turn the same amount you turn them, and you can also use a joystick instead #include <VarSpeedServo.h> VarSpeedServo servo1; VarSpeedServo servo2; int potpin = 0; int val; int potpin2 = 1; int val1; void setup() { servo1.attach(9); servo2.attach(10); } void loop() { val = analogRead(potpin); val = map(val, 0, 1023, 0, 180); servo1.write(val); val1 = analogRead(potpin2); val1 = map(val1, 0, 1023, 0, 180); servo2.write(val1); }