Servo responding to button

Well my team wants to use the camera pan and tilt assembly to respond to the bottoms on the top of the joystick could someone help I don’t know we’re to start everything I have tried has not worked

Can you rephrase that? It sounds very confusing. And what exactly do you mean by “respond to”?

If a button is pressed the camera on the servo moves up one degree or so

So in order to move the camera up ten degrees, you would have to press the button ten times? If you want to be able to hold the button down for continuous motion, how quickly (degrees per second) do you want the camera to move? Do you ever want to move the camera down? You mentioned the pan and tilt assembly; do you also want to be able to move the camera from side to side?

I’ll assume you want to control a pair of servos with two pairs of buttons, one button each for up, down, left, and right. Is that correct? If so, which buttons do you want to use?

i was thinking of something like

void operatorcontrol()
double degree;
if(button is pressed)
degree incremented up
update servo

do you have code that works for a joystick button and code that works for a servo
if so could you post it
or even if you have the exact code we need

even if you do not any help will be appreciated


Also the Previous assumption is correct

If you don’t answer the specific questions, I can’t give you any specific advice.

Do you know how to read the value of a joystick button?

Do you know how to set the angle of a servo?

Do you know how to use static variables to remember a value between runs of a function?

Question 1: Yes
Question 2: Not really
Question 3: Why but not really