Code: Select all
task C_MOTOR () //This task is working as expected
{
int speed;
SetSensorType (IN_1, SENSOR_TYPE_TOUCH);
SetSensorMode (IN_1, SENSOR_MODE_RAW);
while (true)
{
speed = SENSOR_1;
speed -= 3;
speed /=5;
NumOut (0, 0, speed);
RemoteSetOutputState (1, OUT_C, speed, OUT_MODE_MOTORON, OUT_REGMODE_IDLE, 0, OUT_RUNSTATE_RUNNING, 0);
Wait (50);
}
}
task A_MOTOR () //This task seems to be "ignoring" the RemotSetOutputState command
{
int speed;
SetSensorType (IN_4, SENSOR_TYPE_TOUCH);
SetSensorMode (IN_4, SENSOR_MODE_RAW);
while (true)
{
speed = SENSOR_4;
speed -= 3;
speed /=5;
NumOut (30, 0, speed);
RemoteSetOutputState (1, OUT_A, speed, OUT_MODE_MOTORON, OUT_REGMODE_IDLE, 0, OUT_RUNSTATE_RUNNING, 0);
Wait (50);
}
}
task main ()
{
Precedes (A_MOTOR, C_MOTOR);
}
Thank you