Hi,
We keep running into a problem hoping to find some help here.
For vex IQ squared away we have a ball intake with basket. The balls are dropped from the basket using trap door type set up.
The general code to drop the balls is here:
while(true):
{
// our driver control code here such as-- setMotorSpeed(leftMotor, getJoystickValue(ChA)) , ect.
if(getJoystickValue(BtnEDown) == 1 && getJoystickValue(BtnEUp) == 1)
{
setMotorTarget(backPack, 705, 100);
delay(600);
setMotorTarget(backPack, 400, 100);
waitUntilMotorStop(backPack);
}
}
The back hooks push on a lever at position 705, hold for 600ms while balls drop then the hooks move back to cube release position.
The delay is to ensure that the motor target of 705 was reached to fully push the ball release lever.
Our problem is that when ever the delay is running or the command waitUntilMotor stop is running, we loose all control of the robot. Worst of all, if the bot was moving when the command was started it continues to move- such as if the robot was turning it keeps turning until the delay or waitUntilMotorstop is complete.
Can “Tasks” help with this? can anyone tell me a short answer what the difference is between Tasks and “functions”?
Any help is appreciated!