/******************************************************************************* * FUNCTION: eEMPing * * PARAMETERS: * ~ ucId - External Module ID. * * RETURN: * ~ Error Code. * * DESCRIPTIONS: * Send the ping command to external modules. * This is used to check whether an external module is connected. * *******************************************************************************/ EM_ERROR eEMPing(unsigned char ucId)
Example:
if (eEMPing(unsigned char ucId) == EM_NO_ERROR) { // External module with ID 100 is found. } else { // External module with ID 100 is not found. }
/******************************************************************************* * FUNCTION: eEMGetModel * * PARAMETERS: * ~ ucId - External Module ID. * ~ peModel - Buffer to return the model. * * RETURN: * ~ Error Code. * * DESCRIPTIONS: * Get the external module model. * *******************************************************************************/ EM_ERROR eEMGetModel(unsigned char ucId, EM_MODEL *peModel)
EM_MODEL eModel; EM_ERROR eErrorCode; eErrorCode = eEMGetModel(100, &eModel); if ((eErrorCode == EM_NO_ERROR) && (eModel == EM_MODEL_G15)) { // Connected external module with ID 100 is G15 servo motor. }
There was an error while loading. Please reload this page.