Main repository for dump truck API development in Spring 2017

Dependencies:   Tracker mbed MotorV2 SRF05 nRF24L01P

Fork of DUMP_TRUCK_TEST_V1 by Terrabots

Activities

This Week

If needed, please contact Milo Pan at mpan9@gatech.edu for rights and access to this repository.

Revision:
13:112b6543909a
Parent:
12:502cf4fc6d98
Child:
14:fd6090cddc2e
--- a/DumpTruck.h	Thu Mar 30 17:27:21 2017 +0000
+++ b/DumpTruck.h	Thu Apr 13 17:32:44 2017 +0000
@@ -17,6 +17,11 @@
 #include "nRF24L01P.h" //Transceiver library
 #include "SRF05.h"
 
+//using strings to process commands
+#include <string> 
+#include <stdio.h>
+using namespace std;
+
 #define TRANSFER_SIZE   8
 
 // ADD SWITCHES & ULTRASONIC SENSOR implementation
@@ -37,6 +42,23 @@
     DumpTruck(int truckId);
 
     /*
+    *   Process command
+    */
+    void processCommand();
+
+    /*
+    *   Send not acknowledge
+    */
+
+    void sendNack();
+
+    /*
+    *   Send acknowledge
+    */
+
+    void sendAck();
+    
+    /*
     *   Initialize transceiver.
     */
     void startComms();
@@ -71,7 +93,17 @@
     /*
     *   Stop driving.
     */
-    void stop();                            // all Motors
+    int stopDrive();                            // all Motors
+    
+    /*
+    *   Stop turning.
+    */
+    int stopTurn();                            // all Motors
+
+    /*
+    *   Stop bed.
+    */
+    int stopBed();                            // all Motors
 
     // ultrasonic functions
     /*
@@ -79,6 +111,13 @@
     *   proximity from objects.
     */
     bool detect();                          // returns bool for object too close
+    
+    int txDataCnt;
+    int rxDataCnt;
+    char txData[TRANSFER_SIZE], rxData[TRANSFER_SIZE];
+    char acked[TRANSFER_SIZE];
+    char nacked[TRANSFER_SIZE]; 
+    bool received;
 
 
 protected:
@@ -107,9 +146,9 @@
     bool tooClose;
     float proximity;
     
-    int txDataCnt;
+    /*int txDataCnt;
     int rxDataCnt;
     char txData[TRANSFER_SIZE], rxData[TRANSFER_SIZE];
-    bool received;
+    bool received;*/
 };
 #endif