#include "variables.h"
#include "utility.h"
Go to the source code of this file.
Functions |
void | irCommInit () |
| Initialize the IR communication; need to be called only once.
|
void | irCommInitReceiver () |
| Initialize the IR communication state machine in reception mode (used internally).
|
void | irCommInitTransmitter () |
| Initialize the IR communication state machine in transmission mode (used internally).
|
void | irCommDeinit () |
| Stop the IR communication, only sensors sampling for obstacle and cliff avoidance is enabled.
|
void | irCommTasks () |
| Handle the internal state machine of the IR communication. Need to be called repeatedly from the main loop.
|
void | irCommSendData (unsigned char value) |
| Set the data to be sent through IR; the obstacle avoidance and cliff avoidance will be disabled during the transmission.
|
unsigned char | irCommDataSent () |
| Tell whether the last transmission is terminated or not.
|
unsigned char | irCommDataAvailable () |
| Tell whether incoming data are received or not.
|
unsigned char | irCommReadData () |
| Get the last byte received through IR.
|
signed char | irCommReceivingSensor () |
| Get the last sensor id that receives the message.
|
signed int | getBearing (unsigned char sensor) |
| Get the direction of the sensor that receives the last message.
|
Function Documentation
Get the direction of the sensor that receives the last message.
- Returns:
- the angle of the sensor (-180..180)
Tell whether incoming data are received or not.
- Returns:
- 1 if one byte is received, 0 otherwise
Tell whether the last transmission is terminated or not.
- Returns:
- 1 if the last byte is sent, 0 otherwise
Stop the IR communication, only sensors sampling for obstacle and cliff avoidance is enabled.
- Returns:
- none
Initialize the IR communication; need to be called only once.
- Returns:
- none
Initialize the IR communication state machine in reception mode (used internally).
- Returns:
- none
Initialize the IR communication state machine in transmission mode (used internally).
- Returns:
- none
Get the last byte received through IR.
- Returns:
- the value of the byte received
Get the last sensor id that receives the message.
- Returns:
- the sensor id (0..7); 0 is the front sensor, sensors id increases clockwise
Set the data to be sent through IR; the obstacle avoidance and cliff avoidance will be disabled during the transmission.
- Parameters:
-
value,: | byte to be sent; sensor: sensor id mask (bit 0 corresponds to sensor 0 in front of robot, id increases clockwise). |
- Returns:
- none Set the data to be sent through IR; the obstacle avoidance and cliff avoidance will be disabled during the transmission.
- Parameters:
-
value,: | byte to be sent; sensor. |
- Returns:
- none
Handle the internal state machine of the IR communication. Need to be called repeatedly from the main loop.
- Returns:
- none