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:
- 15:a4bbdde8ed69
- Parent:
- 14:fd6090cddc2e
- Child:
- 16:6530f62dd28b
--- a/DumpTruck.h Tue Apr 25 05:24:47 2017 +0000 +++ b/DumpTruck.h Tue Apr 25 20:54:15 2017 +0000 @@ -39,24 +39,24 @@ DumpTruck(int truckId); /* - * Process command + * Process command, parsing it and calling the associated function. */ void processCommand(); /* - * Send not acknowledge + * Send not acknowledge to base station. */ void sendNack(); /* - * Send acknowledge + * Send acknowledge to base station. */ void sendAck(); /* - * Initialize transceiver. + * Initialize transceiver and other miscellaneous devices. */ void startComms(); @@ -96,6 +96,12 @@ * Stop turning. */ void stopTurn(); // all Motors + + /* + * Stop all motors if an object comes within range of the + * ultrasonic sensor + */ + void detectStop(); /* * Stop bed. @@ -119,6 +125,8 @@ int commandValue; typedef void (DumpTruck::*funcArray)(void); funcArray commArr[sizeof(commands)/sizeof(*commands)]; + float zeroAngle; + bool interrupted; protected: Tracker *track; @@ -128,6 +136,7 @@ Motor *bedMotor; nRF24L01P *nrf; //Transceiver *nrf; SRF05 *srf; + AnalogIn *pot; // add direct control for motor, switch, and ultrasonic sensor.