FIRST Tech Challenge Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Buttons on FTC Controller

I am trying to use one button to move 2 servos upward in move in 2 different directions at once and than another button to move it down. How can I do that?

0 Kudos
Message 1 of 2
(3,275 Views)

Can you be more specific? 

In doing so:

  1. Try to label the servos "A", "B", "C", ...  and give clear values for Buttons "1", "2", "3", ...
  2. Identify limits on the servos - you want the servo to move TO position X or TO position Y, or you want the servo to move FROM position X TO position Y in increments of Z (not allowing the servo to go lower than X or higher than Y).
  3. Identify initial starting position - where do you want the servo to be when the program starts (where is the default position)?
  4. Give clear explanations to your actions; for example: 
    • "When I press Button 4, I want servos A and B to move to position 127."
    • "While Button 2 is pressed, I want Servo A to move in a positive direction in steps of 5 servo positions (with limits 0 to 150)."
    • "If I press Button 6, I want Servo C to move to position 127, and then when I press it again I want Servo C to return to position 30."


I think what you're asking for is to have a single button to control two servos identically, such that when you press Button 3 you want the servos to move in a positive direction in steps of 5 servo positions (though you don't mention the lower or upper limits, nor the starting position) and when you press Button 4 you want both servos to move in a negative direction in steps of 5 servo positions.

If you give me a specific instruction, I can write you some example code to perform your action.

-Danny

0 Kudos
Message 2 of 2
(2,805 Views)