Dwengo Robot Sensor board routines. More...
#include "dwengoBoard.h"
Defines | |
#define | DIFF_MODE 0 |
#define | AMBIENT_MODE 1 |
#define | ACTIVE_MODE 2 |
#define | OS1 0 |
#define | OS2 1 |
#define | OS3 2 |
#define | OS4 3 |
#define | OS5 4 |
#define | OS6 5 |
#define | OS7 6 |
#define | OS8 9 |
#define | D1 7 |
#define | D2 8 |
#define | LD1 0 |
#define | LD2 1 |
Functions | |
void | initSensorModule (void) |
Configures the Dwengo Robot Sensor board. | |
void | setHeadlights (BYTE side, BYTE state) |
Turn the robot headlights on or off. | |
BYTE | readSensor (BYTE sensor, BYTE modus) |
Read one of the sensors from the module. | |
void | powerLongRange (BYTE state) |
Set the power of the long range distance sensor. |
Dwengo Robot Sensor board routines.
Library to control the Dwengo Robot Sensor board.
void initSensorModule | ( | void | ) |
Configures the Dwengo Robot Sensor board.
Initialize the Dwengo Robot Sensor board
void powerLongRange | ( | BYTE | state | ) |
Set the power of the long range distance sensor.
state | can be TRUE or FALSE wether you want the long range sensor to be powered or not. Can be used to improve battery life. |
BYTE readSensor | ( | BYTE | sensor, |
BYTE | modus | ||
) |
Read one of the sensors from the module.
Returns value corresponding with the sensor
sensor | Choose the sensor. Can be OSx, where x is the number of the sensor you want. |
modus | Choose the measuring modus. Can be: DIFF_MODE, AMBIENT_MODE or ACTIVE_MODE |
void setHeadlights | ( | BYTE | side, |
BYTE | state | ||
) |
Turn the robot headlights on or off.
side | Choose the headlight LD1 (right) or LD2 (left) |
state | TRUE turns on the LED; FALSE turns it off. |