Roomba Tank
CSC 460 Project 3
Macros | Functions
roomba.h File Reference
#include <stdint.h>

Go to the source code of this file.

Macros

#define START   128
 
#define CONTROL_MODE   130
 
#define SAFE_MODE   131
 
#define FULL_MODE   132
 
#define POWER   133
 
#define DRIVE   137
 
#define SONG   140
 
#define PLAY   141
 
#define SENSORS   142
 
#define QUERYLIST   149
 
#define SENSOR_ALL_DATA   0
 
#define SENSOR_SUB_1   1
 
#define SENSOR_SUB_2   2
 
#define SENSOR_SUB_3   3
 
#define ROOMBA_SPEED   250
 
#define ROOMBA_TURN   150
 
#define TURN_RADIUS   400
 
#define AUTOTURN_RADIUS   350
 
#define DRIVE_STRAIGHT   32768
 
#define IN_PLACE_CW   -1
 
#define IN_PLACE_CCW   1
 

Functions

void Roomba_Init (void)
 
void Roomba_Drive (int16_t velocity, int16_t radius)
 
void Roomba_Play (uint8_t song)
 
void Roomba_Sensors (uint8_t packet_id)
 
void Roomba_QueryList (uint8_t packet1, uint8_t packet2)
 
void Roomba_Song (uint8_t n)
 

Macro Definition Documentation

#define AUTOTURN_RADIUS   350

Definition at line 39 of file roomba.h.

#define CONTROL_MODE   130

Definition at line 15 of file roomba.h.

#define DRIVE   137

Definition at line 19 of file roomba.h.

#define DRIVE_STRAIGHT   32768

Definition at line 40 of file roomba.h.

#define FULL_MODE   132

Definition at line 17 of file roomba.h.

#define IN_PLACE_CCW   1

Definition at line 42 of file roomba.h.

#define IN_PLACE_CW   -1

Definition at line 41 of file roomba.h.

#define PLAY   141

Definition at line 21 of file roomba.h.

#define POWER   133

Definition at line 18 of file roomba.h.

#define QUERYLIST   149

Definition at line 23 of file roomba.h.

#define ROOMBA_SPEED   250

Data special cases

Definition at line 36 of file roomba.h.

#define ROOMBA_TURN   150

Definition at line 37 of file roomba.h.

#define SAFE_MODE   131

Definition at line 16 of file roomba.h.

#define SENSOR_ALL_DATA   0

Sensors

Definition at line 28 of file roomba.h.

#define SENSOR_SUB_1   1

Definition at line 29 of file roomba.h.

#define SENSOR_SUB_2   2

Definition at line 30 of file roomba.h.

#define SENSOR_SUB_3   3

Definition at line 31 of file roomba.h.

#define SENSORS   142

Definition at line 22 of file roomba.h.

#define SONG   140

Definition at line 20 of file roomba.h.

#define START   128

Roomba serial opcodes

Definition at line 14 of file roomba.h.

#define TURN_RADIUS   400

Definition at line 38 of file roomba.h.

Function Documentation

void Roomba_Drive ( int16_t  velocity,
int16_t  radius 
)

Tells the roomba to drive with the given velocity and radius

Definition at line 50 of file roomba.c.

void Roomba_Init ( void  )

Wakes Roomba from sleep and sets it to safe mode

Definition at line 13 of file roomba.c.

void Roomba_Play ( uint8_t  song)

Plays the song corresponding to a song # from 0-4

Definition at line 61 of file roomba.c.

void Roomba_QueryList ( uint8_t  packet1,
uint8_t  packet2 
)

Requests multiple packets from the Roomba

Definition at line 77 of file roomba.c.

void Roomba_Sensors ( uint8_t  packet_id)

Requests a packet from the Roomba about a specific sensor

Definition at line 69 of file roomba.c.

void Roomba_Song ( uint8_t  n)

Loads a song onto the Roomba

Definition at line 87 of file roomba.c.