Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: LineSensors mbed
DriveController.h@15:150ec9448efc, 2015-04-18 (annotated)
- Committer:
- Hypna
- Date:
- Sat Apr 18 02:54:55 2015 +0000
- Revision:
- 15:150ec9448efc
- Parent:
- 13:aa6f64c73271
experiment
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Hypna | 0:e60f22c1d573 | 1 | #ifndef DRIVECONTROLLER_H |
Hypna | 0:e60f22c1d573 | 2 | #define DRIVECONTROLLER_H |
Hypna | 0:e60f22c1d573 | 3 | #include "mbed.h" |
Hypna | 5:f53f06a866e9 | 4 | #include "LineSensors.h" |
Hypna | 0:e60f22c1d573 | 5 | |
Hypna | 0:e60f22c1d573 | 6 | class DriveController |
Hypna | 0:e60f22c1d573 | 7 | { |
Hypna | 0:e60f22c1d573 | 8 | private: |
Hypna | 13:aa6f64c73271 | 9 | PwmOut treadSpeed1; |
Hypna | 13:aa6f64c73271 | 10 | PwmOut treadSpeed2; |
Hypna | 2:d0ce8e26cbc4 | 11 | |
Hypna | 13:aa6f64c73271 | 12 | DigitalOut treadDirection1; |
Hypna | 13:aa6f64c73271 | 13 | DigitalOut treadDirection2; |
Hypna | 4:ac6b2e5b240b | 14 | |
Hypna | 15:150ec9448efc | 15 | DigitalInOut com1; |
Hypna | 15:150ec9448efc | 16 | DigitalInOut com2; |
Hypna | 4:ac6b2e5b240b | 17 | |
Hypna | 5:f53f06a866e9 | 18 | LineSensors sensors; |
Hypna | 5:f53f06a866e9 | 19 | bool sensorStates[8][3]; |
Hypna | 0:e60f22c1d573 | 20 | |
Hypna | 13:aa6f64c73271 | 21 | char command; |
Hypna | 0:e60f22c1d573 | 22 | |
Hypna | 5:f53f06a866e9 | 23 | void move(char direction = 'F'); |
Hypna | 2:d0ce8e26cbc4 | 24 | void getCommand(); |
Hypna | 5:f53f06a866e9 | 25 | void rotate(char direction); |
Hypna | 12:edcae0f36e9c | 26 | void spinTest(); |
Hypna | 12:edcae0f36e9c | 27 | double calculateError(); |
Hypna | 2:d0ce8e26cbc4 | 28 | bool intersection(); |
Hypna | 0:e60f22c1d573 | 29 | |
Hypna | 0:e60f22c1d573 | 30 | public: |
Hypna | 2:d0ce8e26cbc4 | 31 | DriveController(); |
Hypna | 0:e60f22c1d573 | 32 | void go(); |
Hypna | 0:e60f22c1d573 | 33 | }; |
Hypna | 0:e60f22c1d573 | 34 | |
Hypna | 0:e60f22c1d573 | 35 | #endif |