73335T
October 27, 2019, 6:43am
#1
SuckL.spin(directionType::fwd, -100, velocityUnits::rpm);
SuckR.spin(directionType::rev, -100, velocityUnits::rpm);
Tray.spin(directionType::fwd, -100, velocityUnits::rpm);
vex::task::sleep(3000);
Tray.spin(directionType::fwd, 100, velocityUnits::rpm);
vex::task::sleep(1000);
all of this works… until I added the sleep function. What is the problem?
I’m assuming your problem is that everything keeps on running? Using task::sleep doesn’t turn off the motor it only adds a delay. If you want the motor to stop use SuckL.stop().
1 Like
73335T
October 27, 2019, 7:17am
#3
Ok so this is on our autonomous, and we want to keep the program going for 1 second.
So after the 1 second, turn off all the motors by doing
SuckL.stop();
SuckR.stop();
Tray.stop();
1 Like