| init.c |
startup code and simple
command-line interface. The demo() function runs the high-level
control code for the robot. |
| fqd.c / fqd.h |
Code to control a pair of TPU
channels to do quadrature decode. (Used to read the 2 motor
encoders) |
| tpu.c / tpu.h |
General code to
configure/control the TPU. |
| mcpwm.c / mcpwm.h |
Code to control 3 TPU channels
to generate 2 PWM signals (Used to control the two main drive
motors) |
| lcd.c / lcd.h |
Code to write to the LCD
display. |
| motor.c / motor.h |
Contains the mid-level motor
control code: all the PID loops as well as the motion control code. More
details below. |
| servo.c / servo.h |
Code to control TPU channels to
generate R/C servo signals. |
| distance.c / distance.h |
Code to read GP2D02 distance
sensors. Starts a task that reads the sensors as fast as possible, and
stores the readings in global variables. Also provides an interface for
other tasks to read the most recent sensor values.
|
| spi.c / spi.h |
Contains basic SPI interface
code. Used to interface to the AtoD converters in the two IR arrays.
|
| robot.c |
Contains high-level robot
control code. More details below. |
| flame.c / flame.h |
Code to use a TPU channel to
read the output from the UVTRON driver board. Sets the TPU channel into
PTA mode to count pulses, and every 100ms it rolls it into an array of
the last 10 counts. Also provides an interface to read the most recent
count, which just sums up the 10 entries in the array.
|
| mcp3208.c / mcp3208.h |
Code to interface with a
mcp3208 AtoD converter. Used to for the 2 IR arrays.
|
| gyro.c / gyro.h |
Basic code to read the gyro
sensor. |
| pta.c / pta.h |
Code to configure a TPU channel
in PTA mode. Used to read the accelerometer, as well as to listen for
the beep to start the robot.
|
| accel.c / accel.h |
Code to read the accelerometer. |
| kalman.c / kalman.h |
Kalman filter code - used to
combine the readings from the gyro and accelerometer to get the current
tilt of the robot. The original version of this code is in imu/imu-1d.c
|
| f16_16.c / f16_16.h |
Fixed-point operations with 16
bits of integer and 16 bits of fraction precision. |
| fastint.c / fastint.h |
Fast trig routines. Downloaded
off the internet from somewhere, and tweaked by me. |
| robot_trace.c / robot_trace.h /
trace.h |
A ring buffer trace utility. |
| tone.c / tone.h |
Code to listen for a tone to
start the robot (or the backup button). |