test program

Dependencies:   LSM9DS1_Library2 MotorV2 SRF05 Tracker2 mbed nRF24L01P

Fork of DUMP_TRUCK_SPR2017 by Terrabots

Revision:
12:502cf4fc6d98
Parent:
10:cf77da9be0b8
Child:
13:112b6543909a
diff -r 87f30625b213 -r 502cf4fc6d98 DumpTruck.h
--- 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