One button, two motors on button press and run until pressed again

We can’t figure this out in vexcode blocks. Here is what we are trying to do for an intake. any ideas?

When press and release button, spin motor 1 and motor 2
When press and release button again, stop motor 1 and motor 2

Any help or advice is appreciated. Thank you.

See attached code snippet. codesnippet

First, for the if statement, put it all in an infinite loop. Second, try using an if statement see if the motor is moving. If it is moving, then stop the motors. Else, keep the motors running.
image
EDIT: The motor2 and motor3 should be motor3 and motor4. Sorry.

4 Likes

Thanks. We’ll try that out and I’ll report back.

3 Likes