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.
Diff: DumpTruck.h
- Revision:
- 12:502cf4fc6d98
- Parent:
- 10:cf77da9be0b8
- Child:
- 13:112b6543909a
--- a/DumpTruck.h Tue Mar 14 20:10:27 2017 +0000 +++ b/DumpTruck.h Thu Mar 30 17:27:21 2017 +0000 @@ -14,9 +14,11 @@ #include "Tracker.h" //#include "IMU.h" #include "Motor.h" -//#include "Transceiver.h" +#include "nRF24L01P.h" //Transceiver library #include "SRF05.h" +#define TRANSFER_SIZE 8 + // ADD SWITCHES & ULTRASONIC SENSOR implementation /** @@ -34,6 +36,21 @@ */ DumpTruck(int truckId); + /* + * Initialize transceiver. + */ + void startComms(); + + /* + * Receive a command from base station. + */ + void getCommand(); + + /* + * Send important data back to the base station. + */ + void reportData(); + // motor functions /* * Drive a certain distance at a desired speed. @@ -70,7 +87,7 @@ Motor *frontMotor; Motor *turnMotor; Motor *bedMotor; - //Transceiver *nrf; + nRF24L01P *nrf; //Transceiver *nrf; SRF05 *srf; // add direct control for motor, switch, and ultrasonic sensor. @@ -89,5 +106,10 @@ // ultrasonic-specific variables bool tooClose; float proximity; + + int txDataCnt; + int rxDataCnt; + char txData[TRANSFER_SIZE], rxData[TRANSFER_SIZE]; + bool received; }; #endif