| aServo_SetConfig | Index |
Definition:
| aErr aServo_SetConfig( | aStemLib stemRef, const unsigned char module, const unsigned char nServoIndex, const unsigned char nConfigValue); |
Parameters:
| stemRef | - | An opaque library reference representing the aStem library which manages the communication with the BrainStem modules. |
| module | - | The IIC address of the module that will receive new configuration data for one of its servo pins. This need not be the router. |
| nServoIndex | - | The index of the servo. |
| nConfigValue | - | The new configuration value. |
Return Value:
Description:
This routine manages the BrainStem packets needed to set the configuration byte of a servo output. The following defined bit masks may be used to configure servo outputs.
| aSERVO_ENA | 128 | Set to enable the PWM output at a servo pin. Clear to disable the PWM output at a servo pin. |
| aSERVO_INV | 64 | Set to use inverted positions for a servo. Clear to use normal positions for a servo. |
| aSERVO_DSTA | 32 | Set to make the servo output remain high when the PWM is disabled. Clear to make the servo output remain low when the PWM is disabled. |
Add or logical-OR a value from 1 to 15 to the configuration bits to perform a speed-controlled servo motion. The value 1 is the slowest speed and 15 is the fastest. A speed of 0 will disable the speed function and make the servo move from one position to another as fast as it can go.
Related: