| aServo_SetReflex | Index |
Definition:
Parameters:
| servo | - | The index of the servo pin whose reflex params are to be set. |
| reflex | - | The reflex parameters combined into an int. |
Return Value:
Description:
This routine sets the enable bit, reflex message value, and raw input parameter for a servo speed-controlled motion. If a servo has a non-zero speed, it can trigger a reflex once it has completed its motion. The high byte of the input parameter contains the enable bit and reflex message value. If the enable bit (bit 7) is set, the servo will trigger a reflex with the message value when it completes its motion. The low byte contains the raw input parameter that will be passed by the reflex when the servo completes its motion. Once a servo completes a speed-controlled motion, its reflex parameters must be reset before the servo can trigger another reflex.
Example:
aServo_SetReflex(0, 0xE40A);
This would enable the triggering of reflex 100 with a parameter of 10 when servo 0 completes its next speed-controlled motion. The high byte 0xE4 is 128+100, which is equivalent to a set enable bit (bit 7) and a reflex message of 100.
Related: