test program

Dependencies:   LSM9DS1_Library2 MotorV2 SRF05 Tracker2 mbed nRF24L01P

Fork of DUMP_TRUCK_SPR2017 by Terrabots

Committer:
simplyellow
Date:
Tue Feb 28 21:11:48 2017 +0000
Revision:
10:cf77da9be0b8
Parent:
5:dc4cf6cc24b3
Child:
11:87f30625b213
updated dump truck class configured to test the dump truck's driving and object sensing capability.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
simplyellow 10:cf77da9be0b8 1 #include "DumpTruck.h"
simplyellow 10:cf77da9be0b8 2 DumpTruck dump(1);
Josahty 0:6942f0e2198c 3
simplyellow 10:cf77da9be0b8 4 /*
simplyellow 10:cf77da9be0b8 5 test code for driving and stopping when an object gets too close
simplyellow 10:cf77da9be0b8 6 to the dump truck.
simplyellow 10:cf77da9be0b8 7 */
simplyellow 5:dc4cf6cc24b3 8
simplyellow 10:cf77da9be0b8 9 int main() {
simplyellow 10:cf77da9be0b8 10 while(1) {
simplyellow 10:cf77da9be0b8 11 if(dump.detect()) {
simplyellow 10:cf77da9be0b8 12 dump.stop();
simplyellow 10:cf77da9be0b8 13 } else {
simplyellow 10:cf77da9be0b8 14 dump.drive(0.5f);
simplyellow 10:cf77da9be0b8 15 }
simplyellow 5:dc4cf6cc24b3 16 }
simplyellow 10:cf77da9be0b8 17
simplyellow 5:dc4cf6cc24b3 18 }