TomYumBoys / Mbed 2 deprecated MM2017

Dependencies:   mbed

Committer:
kolanery
Date:
Sat May 13 21:27:32 2017 +0000
Revision:
4:73510c7fa316
Parent:
2:619b02232144
Child:
5:d783972dce10
update pid control

Who changed what in which revision?

UserRevisionLine numberNew contents of line
kolanery 0:cb667de3a336 1 #ifndef __DRIVE_CONTROL_H__
kolanery 0:cb667de3a336 2 #define __DRIVE_CONTROL_H__
kolanery 0:cb667de3a336 3
kolanery 0:cb667de3a336 4 /**
kolanery 0:cb667de3a336 5 * Control mouse movements.
kolanery 0:cb667de3a336 6 * - PID Control based on sensor readings.
kolanery 0:cb667de3a336 7 * - Output PWM signals to motors based on feedback loop.
kolanery 0:cb667de3a336 8 * - Provides directional signals to the main control loop.
kolanery 0:cb667de3a336 9 */
kolanery 0:cb667de3a336 10 class DriveControl {
kolanery 0:cb667de3a336 11
kolanery 0:cb667de3a336 12 public:
kolanery 0:cb667de3a336 13 int y;
kolanery 0:cb667de3a336 14 int x;
kolanery 0:cb667de3a336 15 DriveControl (int start_x, int start_y);
kolanery 0:cb667de3a336 16 ~DriveControl();
kolanery 0:cb667de3a336 17
kolanery 0:cb667de3a336 18 int get_next_direction();
kolanery 0:cb667de3a336 19
kolanery 0:cb667de3a336 20 int get_next_state(int state);
kolanery 0:cb667de3a336 21
kolanery 0:cb667de3a336 22 // Stops both motors. Assume no coasting.
kolanery 0:cb667de3a336 23 void stop();
kolanery 0:cb667de3a336 24
kolanery 0:cb667de3a336 25 void drive_one_forward();
kolanery 0:cb667de3a336 26
kolanery 0:cb667de3a336 27 void turn();
kolanery 0:cb667de3a336 28
kolanery 0:cb667de3a336 29 void turn_left();
kolanery 0:cb667de3a336 30
kolanery 0:cb667de3a336 31 void turn_right();
kolanery 0:cb667de3a336 32
kolanery 4:73510c7fa316 33 void drive(float speed);
kolanery 4:73510c7fa316 34
kolanery 0:cb667de3a336 35 bool has_front_wall();
kolanery 0:cb667de3a336 36
kolanery 0:cb667de3a336 37 bool has_right_wall();
kolanery 0:cb667de3a336 38
kolanery 0:cb667de3a336 39 bool has_left_wall();
kolanery 0:cb667de3a336 40 };
kolanery 0:cb667de3a336 41 #endif