2

Here's my code. I don't know if the issue is the power source though. I only have access to my computer for a power source.

#include <Servo.h>

Servo servo1; Servo servo2; Servo servo3; Servo servo4;

int joyX = A2; int joyY = A5; int Joyx = A2; int Joyy = A5;

int servoVal;

void setup() { servo1.attach(A0); servo2.attach(A1); servo3.attach(A3); servo4.attach(A4); }

void loop() {

servoVal = analogRead(joyX); servoVal = map(servoVal, 0, 1023, 0, 180); servo1.write(servoVal); delay(15);

servoVal = analogRead(joyY); servoVal = map(servoVal, 0, 1023, 70, 180); servo2.write(servoVal); delay(15);

servoVal = analogRead(Joyx); servoVal = map(servoVal, 0, 1023, 0, 180); servo3.write(servoVal); delay(15);

servoVal = analogRead(Joyy); servoVal = map(servoVal, 0, 1023, 70, 180); servo4.write(servoVal); delay(15);
}

st2000
  • 7,513
  • 2
  • 13
  • 19

0 Answers0