re-entrant motor control
Posted: 17 Aug 2011, 07:56
Hi all
I'm using NXC, and I'm curious about what causes the following behaviour, and wondering how to specify re-entrant functions if thats possible.
If I user the following code:
RotateMotor(OUT_A, 50, 360);
RotateMotor(OUT_C, 50, 360);
First motor A moves and only when that’s done motor C moves.
If I use:
PosRegAddAngle(OUT_A, 360);
PosRegAddAngle(OUT_C, 360);
I get both motors running in parallel.
From this I figure that its possible to specify that some functions are re-entrant and others not.
How is this done? Or have I come to the wrong conclusion and there is another reason for these functions to behave differently?
Thanks
Anthony
I'm using NXC, and I'm curious about what causes the following behaviour, and wondering how to specify re-entrant functions if thats possible.
If I user the following code:
RotateMotor(OUT_A, 50, 360);
RotateMotor(OUT_C, 50, 360);
First motor A moves and only when that’s done motor C moves.
If I use:
PosRegAddAngle(OUT_A, 360);
PosRegAddAngle(OUT_C, 360);
I get both motors running in parallel.
From this I figure that its possible to specify that some functions are re-entrant and others not.
How is this done? Or have I come to the wrong conclusion and there is another reason for these functions to behave differently?
Thanks
Anthony