Announcement

Collapse
No announcement yet.

How do I make servos move incrementally when buttons A, B, X, and Y pressed?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do I make servos move incrementally when buttons A, B, X, and Y pressed?

    My team I am in needs help with making our servos move incrementally (aka gradually) when a button is pressed on the controller. I will try to figure this out myself, but I am just gonna post this here just incase I get stumped. Thanks for reading!

  • #2
    You might start by reviewing the following this video:
     

    Comment


    • #3
      Then watch this video:
       

      Comment


      • #4
        It also is beneficial for you to define very clearly what you mean when you say to move the servo incrementally. If you mean that when you push a button and hold it down, the servo rotates in one direction slowly, and stops when you release the button, and a separate button when pressed slowly moves it in the other direction, then you can do it as follows.

        Create a variable and call it what you like, lets say ServoRotate. Set up a simple if do loop. in the IF test, set the true statement to X Button pressed. In the do section create a math plus assignment statement that says ServoRotate = ServoRotate +.01

        You can adjust the value of the constant in the statement above to control the speed of movement.

        The other direction button would decrement the ServoRotate variable, that is ServoRotate = ServoRotate - .01

        Comment

        Working...
        X