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: mbed
DumpTruck.h@0:2fc8a427dbcf, 2016-10-25 (annotated)
- Committer:
 - tamashy
 - Date:
 - Tue Oct 25 19:22:38 2016 +0000
 - Revision:
 - 0:2fc8a427dbcf
 - Child:
 - 1:92832cd0e8c3
 
Skeleton Code
Who changed what in which revision?
| User | Revision | Line number | New contents of line | 
|---|---|---|---|
| tamashy | 0:2fc8a427dbcf | 1 | #ifndef MBED_DUMP_TRUCK_H | 
| tamashy | 0:2fc8a427dbcf | 2 | #define MBED_DUMP_TRUCK_H | 
| tamashy | 0:2fc8a427dbcf | 3 | |
| tamashy | 0:2fc8a427dbcf | 4 | #include "mbed.h" | 
| tamashy | 0:2fc8a427dbcf | 5 | |
| tamashy | 0:2fc8a427dbcf | 6 | Serial pc(USBTX, USBRX); | 
| tamashy | 0:2fc8a427dbcf | 7 | |
| tamashy | 0:2fc8a427dbcf | 8 | class DumpTruck { | 
| tamashy | 0:2fc8a427dbcf | 9 | public: | 
| tamashy | 0:2fc8a427dbcf | 10 | DumpTruck(int truckId); | 
| tamashy | 0:2fc8a427dbcf | 11 | void drive(); // Drive DC motors with a desired motor speed and distance | 
| tamashy | 0:2fc8a427dbcf | 12 | void RotateTo(); | 
| tamashy | 0:2fc8a427dbcf | 13 | void BedDown(); | 
| tamashy | 0:2fc8a427dbcf | 14 | void BedUp(); | 
| tamashy | 0:2fc8a427dbcf | 15 | void raiseTo(); | 
| tamashy | 0:2fc8a427dbcf | 16 | void LowerBed(); | 
| tamashy | 0:2fc8a427dbcf | 17 | void stop(); | 
| tamashy | 0:2fc8a427dbcf | 18 | |
| tamashy | 0:2fc8a427dbcf | 19 | |
| tamashy | 0:2fc8a427dbcf | 20 | protected: | 
| tamashy | 0:2fc8a427dbcf | 21 | getBedAngle(); //Get data from Bed potentiometer, Hari is looking into the component for this | 
| tamashy | 0:2fc8a427dbcf | 22 | getPivotAngle(double PivotAngle); //Get data from potentiometer | 
| tamashy | 0:2fc8a427dbcf | 23 | SetPivotSpeed(double PivotSpeed); //Set arbitrary rotation of servo motor | 
| tamashy | 0:2fc8a427dbcf | 24 | SetBedSpeed(); //Set arbitrary rotation of DC Motor | 
| tamashy | 0:2fc8a427dbcf | 25 | float speed; | 
| tamashy | 0:2fc8a427dbcf | 26 | float distance; | 
| tamashy | 0:2fc8a427dbcf | 27 | float setTruckSpeed(); // set user inputed truck speed | 
| tamashy | 0:2fc8a427dbcf | 28 | float setTruckDistance(); //get user input for desired distance to be traveled | 
| tamashy | 0:2fc8a427dbcf | 29 | bool GetBedUpperSwitch(bool SwitchState); | 
| tamashy | 0:2fc8a427dbcf | 30 | bool GetBedLowerSwitch(bool SwitchState); | 
| tamashy | 0:2fc8a427dbcf | 31 | bool SwitchState; | 
| tamashy | 0:2fc8a427dbcf | 32 | float distance; //desired distance to have the robot drive | 
| tamashy | 0:2fc8a427dbcf | 33 | float speed; //value between 0 and 1 times the full speed of the robot | 
| tamashy | 0:2fc8a427dbcf | 34 | float DesiredAngle; | 
| tamashy | 0:2fc8a427dbcf | 35 | float PivotSpeed; | 
| tamashy | 0:2fc8a427dbcf | 36 | int truckNumber; | 
| tamashy | 0:2fc8a427dbcf | 37 | bool isCalibrated; | 
| tamashy | 0:2fc8a427dbcf | 38 | }; | 
| tamashy | 0:2fc8a427dbcf | 39 | |
| tamashy | 0:2fc8a427dbcf | 40 | #endif |