Energy harvesting mobile robot. Developed at Institute of Systems and Robotics — University of Coimbra.

Dependencies:   RF24

Dependents:   Mapping VirtualForces_debug OneFileToRuleThemAll VirtualForces_with_class ... more

Embed: (wiki syntax)

« Back to documentation index

robot.h File Reference

robot.h File Reference

Go to the source code of this file.

Functions

void tca9548_select_ch (char ch)
 Selects the wich infrared to comunicate.
float read_Infrared (char ch)
 Get the distance from of the chosen infrared.
void leftMotor (short int Dir, short int Speed)
 Sets speed and direction of the left motor.
void rightMotor (short int Dir, short int Speed)
 Sets speed and direction of the right motor.
long int read16_mcp3424 (char addr)
 Reads adc of the battery.
void write_mcp3424 (int n_bits, int ch, int gain, char addr)
 Reads adc of the battery.
float value_of_Batery ()
 Reads adc of the battery.
static unsigned int get_distance_left_sensor ()
 Returns left sensor value.
static unsigned int get_distance_front_sensor ()
 Returns front sensor value.
static unsigned int get_distance_right_sensor ()
 Returns right sensor value.
void init_nRF (int channel)
 Initializes nrf24l01 module, return value 1 if module is working correcty and 0 if it's not.
void init_robot_pins ()
 Initializes the necessary robot pins.
void initRobot (int channel)
 Initializes all the pins and all the modules necessary.

Detailed Description

Definition in file robot.h.


Function Documentation

static unsigned int get_distance_front_sensor (  ) [static]

Returns front sensor value.

Definition at line 436 of file robot.h.

static unsigned int get_distance_left_sensor (  ) [static]

Returns left sensor value.

Definition at line 415 of file robot.h.

static unsigned int get_distance_right_sensor (  ) [static]

Returns right sensor value.

Definition at line 459 of file robot.h.

void init_nRF ( int  channel )

Initializes nrf24l01 module, return value 1 if module is working correcty and 0 if it's not.

Parameters:
channel- Which RF channel to comunicate on, 0-125
Warning:
Channel on Robot and Board has to be the same.

Definition at line 490 of file robot.h.

void init_robot_pins (  )

Initializes the necessary robot pins.

Definition at line 536 of file robot.h.

void initRobot ( int  channel )

Initializes all the pins and all the modules necessary.

Parameters:
channel- Which RF channel to comunicate on, 0-125.
Note:
If you are not using RF module put random number.
Warning:
Channel on Robot and Board has to be the same.

Definition at line 607 of file robot.h.

void leftMotor ( short int  Dir,
short int  Speed 
)

Sets speed and direction of the left motor.

Parameters:
Dir- Direction of movement, 0 for back, or 1 for fron
Speed- Percentage of speed of the motor (1..100)

Note: Because of differences in the motors they need to be calibrated, test the robot going front and back at different speeds and see if it makes a straigth line

Definition at line 224 of file robot.h.

long int read16_mcp3424 ( char  addr )

Reads adc of the battery.

Parameters:
addr- Address to read
Returns:
The voltage of the baterry

Definition at line 309 of file robot.h.

float read_Infrared ( char  ch )

Get the distance from of the chosen infrared.

Parameters:
ch- Infrared to read (0,1..5)

Note: for the values of ch it reads (0-right, ... ,4-left, 5-back)

Definition at line 199 of file robot.h.

void rightMotor ( short int  Dir,
short int  Speed 
)

Sets speed and direction of the right motor.

Parameters:
Dir- Direction of movement, 0 for back, or 1 for fron
Speed- Percentage of speed of the motor (1..100)

Note: Because of differences in the motors they need to be calibrated, test the robot going front and back at different speeds and see if it makes a straigth line

Definition at line 265 of file robot.h.

void tca9548_select_ch ( char  ch )

Selects the wich infrared to comunicate.

Parameters:
ch- Infrared to read (1..5)

Definition at line 159 of file robot.h.

float value_of_Batery (  )

Reads adc of the battery.

Returns:
The voltage of the batery

Definition at line 356 of file robot.h.

void write_mcp3424 ( int  n_bits,
int  ch,
int  gain,
char  addr 
)

Reads adc of the battery.

Parameters:
n_bits- Resolution of measure
ch- Chose value to read, if voltage or current of solar or batery
gain-
addr- Address to write to

Definition at line 326 of file robot.h.