Announcement

Collapse
No announcement yet.

How to sleep in a FTCopMode (our teleop mode)

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

  • How to sleep in a FTCopMode (our teleop mode)

    We are trying to make an arm that shoots forward then retracts on its own.

    Basically an automated function of the arm.

    we need the arm to go forward for a half second and to reverse for a full second at a slower speed.

    In the linearOpMode you can call the sleep function but you can't call the sleep in the FTCOpMode.

    Any help here? Thanks!

  • #2
    We did that by using a while loop that checks the value of a variable (counter) and then adds one to the variable. The while loop will run until the variable is greater than a number, and then move on. You gotta play with the number to get the time you want.

    Comment


    • #3
      You can also use an elapsed time object and a state machine. Pretty much what you do is create an enum with the states that you would need. The states in this case would be off, extend, retract. Let me know if you need help making this

      Comment

      Working...
      X