Functions which handle the motors. More...
Modules | |
Advanced informations | |
Enumerations | |
enum | eMotorSetMask |
clusters bit masks for writing data to the motors More... | |
enum | eMotorGet |
clusters select values for reading data from the motors More... | |
Request Funktions | |
void | motors_request (eRequestType request) |
Requests new data from the motors. More... | |
uint8_t | motors_received (void) |
Indicates if new data for the data block sMD_Motor was received. More... | |
uint8_t | motors_changed (void) |
Indicates if new data changed the data block sMD_Motor. More... | |
uint8_t | motors_transmitted (void) |
Indicates if the data block sMD_Mode was transmitted. More... | |
Access Funktions | |
int8_t | motors_get (eMotorGet select) |
Returns the last stored power of the selected motor. More... | |
void | motors_set (eMotorSetMask select, int8_t power) |
Sets the motor power of the selected motor(s). More... | |
Functions which handle the motors.
The motors are part of the driving module. All actions, like setting their power level or reading it back, involve internal TWI communication. This may take some milliseconds (delay time).
example
enum eMotorGet |
clusters select values for reading data from the motors
Enumerator | |
---|---|
kMotorGetLeft | constant (kMotorSetLeft): left motor |
kMotorGetRight | constant (kMotorSetRight): right motor |
enum eMotorSetMask |
clusters bit masks for writing data to the motors
Enumerator | |
---|---|
kMotorSetLeft | bit mask (0x01): left motor |
kMotorSetRight | bit mask (0x02): right motor |
kMotorSetAll | bit mask (0x03): both motors |
uint8_t motors_changed | ( | void | ) |
Indicates if new data changed the data block sMD_Motor.
The return value is boolean.
int8_t motors_get | ( | eMotorGet | select | ) |
Returns the last stored power of the selected motor.
This function relies on the internal data block sMD_Motor - for new data use motors_request().
select | value of the selected motor - see also eMotorGet |
uint8_t motors_received | ( | void | ) |
Indicates if new data for the data block sMD_Motor was received.
The return value is boolean.
void motors_request | ( | eRequestType | request | ) |
Requests new data from the motors.
For details on the request schema see The general request.
Involved data blocks are:
sMD_Motor
request | See also eRequestType |
void motors_set | ( | eMotorSetMask | select, |
int8_t | power | ||
) |
Sets the motor power of the selected motor(s).
This function changes the internal data block sMD_Motor.
select | value of the selected motor(s) - see also eMotorSetMask |
power | 8-bit integer (-100..100) The motor power is measured in %. Negative values relate to a motor turning backwards. |
uint8_t motors_transmitted | ( | void | ) |
Indicates if the data block sMD_Mode was transmitted.
The return value is boolean.