as the question title states, how will I go about turning the servo opposite of 90 degrees?
I have written my code as such;
// Turn servo to the right
if(x > 520 && y < 510 && y > 490){
servo.write(0);
delay(50);
//Turn left
}else if(x < 490 && y < 510 && y > 490){
servo.write(180);
delay(50);
//Turn backwards
} else if(y < 490 && x < 520 && x > 490){
servo.write(-90);
delay(50);
Obviously -90 isn't an actual degree on the servo, and it will only turn between 0 and 180. I was therefore wondering if there was any other way to code it?
The servo is connected to a joystick, and the plan is to built a 360 degrees vertical and 180 degrees horizontal turret of sorts. Every other command works, and when I replace -90 with 90 degrees, it works as well. So it is wired correctly.
Of course I would have to add another joystick and another servo later on, but at this stage I am simply testing my own coding skills.