I am super new to programming so I’m having a bit of difficulty finding what I need to do in my particular situation.
I have a 4 button remote that I want to use to activate 4 different behavior states for 2 servos with the first button/state being the default/power on state, which would be both servos being stationary and centered.
With my limited experience I have been able to use the code below to get both servos to move randomly as desired, or with a tweak here and there to get the other 3 states to work, for the servos either moving randomly or remaining stationary and centered. I am not finding, and lack the experience to come up with the code to put it all together and have the remote drive the 4 different behaviors. Any help in this matter would be greatly appreciated.
ypos = random(180); //generate random value for y-servo
yservo.write(ypos); //y-servo moves to new position
xpos = random(180); //generate random value for x-servo
xservo.write(xpos); //x-servo moves to new position