Fabio Faria / ISR_Mini-explorer_tmp

Dependencies:   RF24

Fork of ISR_Mini-explorer by ISR UC

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_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 425 of file robot.h.

static unsigned int get_distance_left_sensor (  ) [static]

Returns left sensor value.

Definition at line 404 of file robot.h.

static unsigned int get_distance_right_sensor (  ) [static]

Returns right sensor value.

Definition at line 448 of file robot.h.

void init_robot_pins (  )

Initializes the necessary robot pins.

Definition at line 477 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 548 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 213 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 298 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 188 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 254 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 148 of file robot.h.

float value_of_Batery (  )

Reads adc of the battery.

Returns:
The voltage of the batery

Definition at line 345 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 315 of file robot.h.