Main repository for dump truck API development in Spring 2017
Dependencies: Tracker mbed MotorV2 SRF05 nRF24L01P
Fork of DUMP_TRUCK_TEST_V1 by
Activities
This Week
If needed, please contact Milo Pan at mpan9@gatech.edu for rights and access to this repository.
main.cpp@15:a4bbdde8ed69, 2017-04-25 (annotated)
- Committer:
- simplyellow
- Date:
- Tue Apr 25 20:54:15 2017 +0000
- Revision:
- 15:a4bbdde8ed69
- Parent:
- 13:112b6543909a
added more comments
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
simplyellow | 10:cf77da9be0b8 | 1 | #include "DumpTruck.h" |
simplyellow | 10:cf77da9be0b8 | 2 | DumpTruck dump(1); |
simplyellow | 13:112b6543909a | 3 | Serial pc(USBTX, USBRX); |
Josahty | 0:6942f0e2198c | 4 | |
simplyellow | 10:cf77da9be0b8 | 5 | /* |
simplyellow | 10:cf77da9be0b8 | 6 | test code for driving and stopping when an object gets too close |
simplyellow | 10:cf77da9be0b8 | 7 | to the dump truck. |
simplyellow | 10:cf77da9be0b8 | 8 | */ |
simplyellow | 5:dc4cf6cc24b3 | 9 | |
simplyellow | 15:a4bbdde8ed69 | 10 | Ticker srf; |
simplyellow | 15:a4bbdde8ed69 | 11 | |
simplyellow | 15:a4bbdde8ed69 | 12 | void avoidCrash() { |
simplyellow | 15:a4bbdde8ed69 | 13 | dump.detect(); |
simplyellow | 15:a4bbdde8ed69 | 14 | } |
simplyellow | 15:a4bbdde8ed69 | 15 | |
simplyellow | 15:a4bbdde8ed69 | 16 | int main() { |
simplyellow | 15:a4bbdde8ed69 | 17 | srf.attach_us(&avoidCrash, 4000); |
simplyellow | 13:112b6543909a | 18 | dump.startComms(); |
simplyellow | 15:a4bbdde8ed69 | 19 | |
simplyellow | 13:112b6543909a | 20 | dump.getCommand(); |
simplyellow | 5:dc4cf6cc24b3 | 21 | } |
simplyellow | 11:87f30625b213 | 22 |