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:
14:fd6090cddc2e
Parent:
13:112b6543909a
Child:
15:a4bbdde8ed69
diff -r 112b6543909a -r fd6090cddc2e DumpTruck.h
--- a/DumpTruck.h	Thu Apr 13 17:32:44 2017 +0000
+++ b/DumpTruck.h	Tue Apr 25 05:24:47 2017 +0000
@@ -16,14 +16,11 @@
 #include "Motor.h"
 #include "nRF24L01P.h" //Transceiver library
 #include "SRF05.h"
-
-//using strings to process commands
-#include <string> 
-#include <stdio.h>
-using namespace std;
+#include "commands.h"
 
 #define TRANSFER_SIZE   8
 
+
 // ADD SWITCHES & ULTRASONIC SENSOR implementation
 
 /**
@@ -77,33 +74,33 @@
     /*
     *   Drive a certain distance at a desired speed.
     */
-    void driveDistance(float speed, float distance);// frontMotor
+    void driveDistance();// frontMotor
     /*
     *   Drive at a desired speed.
     */
-    void drive(float speed);
+    void drive();
     /*
     *   Turn the rear wheels a certain angle.
     */
-    void turn(float angle);                 // turnMotor
+    void turn();                 // turnMotor
     /*
     *   Move the dump truck's bed up/down a certain angle.
     */
-    void moveBed(bool raise, float angle);  // bedMotor
+    void moveBed();  // 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
     /*
@@ -118,9 +115,12 @@
     char acked[TRANSFER_SIZE];
     char nacked[TRANSFER_SIZE]; 
     bool received;
-
-
-protected:
+    int numCommands;
+    int commandValue;
+    typedef void (DumpTruck::*funcArray)(void);
+    funcArray commArr[sizeof(commands)/sizeof(*commands)];
+    
+protected:    
     Tracker *track;
     //IMU *bed;
     Motor *frontMotor;