![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Code to run the microcontrollers on the R5 competition bot
Dependencies: LineSensors mbed
DriveController.h
- Committer:
- jmar11
- Date:
- 2015-04-18
- Revision:
- 17:5046b27f5441
- Parent:
- 16:b49db5c8e16c
- Child:
- 18:2bd595af51d2
File content as of revision 17:5046b27f5441:
#ifndef DRIVECONTROLLER_H #define DRIVECONTROLLER_H #include "mbed.h" #include "LineSensors.h" typedef enum {NORTH, EAST, SOUTH, WEST} abs_direction; //typedef enum {FORWARD, RIGHT, BACK, LEFT} rel_direction; class DriveController { public: typename ::abs_direction orient; PwmOut treadSpeed1; PwmOut treadSpeed2; DigitalOut treadDirection1; DigitalOut treadDirection2; bool sensorStates[8][3]; void spinTest(); double calculateError(); bool intersection(); DriveController(); void move(typename ::abs_direction dir); void rotate(typename ::abs_direction dir); LineSensors sensors; }; #endif