Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Tracker mbed MotorV2 SRF05 nRF24L01P
Fork of DUMP_TRUCK_TEST_V1 by
Revision 16:6530f62dd28b, committed 2017-04-25
- Comitter:
- simplyellow
- Date:
- Tue Apr 25 21:00:53 2017 +0000
- Parent:
- 15:a4bbdde8ed69
- Commit message:
- cleaned for doxygen
Changed in this revision
| DumpTruck.cpp | Show annotated file Show diff for this revision Revisions of this file |
| DumpTruck.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/DumpTruck.cpp Tue Apr 25 20:54:15 2017 +0000
+++ b/DumpTruck.cpp Tue Apr 25 21:00:53 2017 +0000
@@ -76,7 +76,6 @@
received = false;
//acked to receive command
sendAck();
- //possibly implement kill switch/stop current action
//code for receiving
while(!received) {
if (nrf->readable()) {
--- a/DumpTruck.h Tue Apr 25 20:54:15 2017 +0000
+++ b/DumpTruck.h Tue Apr 25 21:00:53 2017 +0000
@@ -12,17 +12,13 @@
#include "mbed.h"
#include "Tracker.h"
-//#include "IMU.h"
#include "Motor.h"
-#include "nRF24L01P.h" //Transceiver library
+#include "nRF24L01P.h"
#include "SRF05.h"
#include "commands.h"
#define TRANSFER_SIZE 8
-
-// ADD SWITCHES & ULTRASONIC SENSOR implementation
-
/**
* @class DumpTruck
*
@@ -38,78 +34,80 @@
*/
DumpTruck(int truckId);
- /*
+ /**
* Process command, parsing it and calling the associated function.
*/
void processCommand();
- /*
+ /**
* Send not acknowledge to base station.
*/
void sendNack();
- /*
+ /**
* Send acknowledge to base station.
*/
void sendAck();
- /*
+ /**
* Initialize transceiver and other miscellaneous devices.
*/
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.
*/
void driveDistance();// frontMotor
- /*
+
+ /**
* Drive at a desired speed.
*/
void drive();
- /*
+
+ /**
* Turn the rear wheels a certain angle.
*/
void turn(); // turnMotor
- /*
+
+ /**
* Move the dump truck's bed up/down a certain angle.
*/
void moveBed(); // bedMotor
- /*
+
+ /**
* Stop driving.
*/
void stopDrive(); // all Motors
- /*
+ /**
* Stop turning.
*/
void stopTurn(); // all Motors
- /*
+ /**
* Stop all motors if an object comes within range of the
* ultrasonic sensor
*/
void detectStop();
- /*
+ /**
* Stop bed.
*/
void stopBed(); // all Motors
- // ultrasonic functions
- /*
+ /**
* Read from the ultrasonic sensor and determine the dump truck's
* proximity from objects.
*/
@@ -154,10 +152,5 @@
// ultrasonic-specific variables
bool tooClose;
float proximity;
-
- /*int txDataCnt;
- int rxDataCnt;
- char txData[TRANSFER_SIZE], rxData[TRANSFER_SIZE];
- bool received;*/
};
#endif
