| aMotion_GetPIDInput | Index |
Definition:
Parameters:
| stemRef | - | An opaque library reference representing the aStem library which manages the communication with the BrainStem modules. |
| module | - | The IIC address of the Moto module that will return the 32-bit encoder setting for one of its motion control channels. This need not be the router. |
| channel | - | The index of the motion control channel. |
| pValue | - | Address of a short where the PID input value will be stored. |
Return Value:
Description:
This routine manages the BrainStem packets needed to request the 2-byte short input value associated with a motion control channel and receive the reply.
Thanks to Jerry Tietz for contributing the code for this routine!
Example:
/* the storage for our value, initialized to zero */ short inputValue = 0; { aErr e; /* get the module 4, channel 0 encoder data */ e = aMotion_GetPIDInput(stemLibRef, 4, 0, &inputValue); if (e == aErrNone) { /* now, encoderValue is filled, provided there was no error */ } } |
Related: