test program
Dependencies: LSM9DS1_Library2 MotorV2 SRF05 Tracker2 mbed nRF24L01P
Fork of DUMP_TRUCK_SPR2017 by
Diff: DumpTruck.h
- Revision:
- 14:192e103d5246
- Parent:
- 13:112b6543909a
diff -r 112b6543909a -r 192e103d5246 DumpTruck.h --- a/DumpTruck.h Thu Apr 13 17:32:44 2017 +0000 +++ b/DumpTruck.h Sun Apr 23 18:59:43 2017 +0000 @@ -16,6 +16,7 @@ #include "Motor.h" #include "nRF24L01P.h" //Transceiver library #include "SRF05.h" +#include "LSM9DS1.h" //using strings to process commands #include <string> @@ -89,21 +90,21 @@ /* * Move the dump truck's bed up/down a certain angle. */ - void moveBed(bool raise, float angle); // bedMotor + void moveBed(bool upper, bool lower, float angle); // bedMotor /* * Stop driving. */ - int stopDrive(); // all Motors + void stopDrive(); // all Motors /* * Stop turning. */ - int stopTurn(); // all Motors + void stopTurn(); // all Motors /* * Stop bed. */ - int stopBed(); // all Motors + void stopBed(); // all Motors // ultrasonic functions /* @@ -128,6 +129,7 @@ Motor *bedMotor; nRF24L01P *nrf; //Transceiver *nrf; SRF05 *srf; + LSM9DS1 *IMU; // add direct control for motor, switch, and ultrasonic sensor. @@ -136,11 +138,19 @@ // motor variables float speed; // drive float distance; // drive + float startDist; // drive + float curDist; // drive float potAngle; // turn float bedAngle; // bed // bed-specific variables bool switchState; // BusIn the two limit switches + float ax0; + float ay0; + float az0; + float ax; + float ay; + float az; // ultrasonic-specific variables bool tooClose;