new version

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers DumpTruck.h Source File

DumpTruck.h

00001 #ifndef MBED_DUMP_TRUCK_H
00002 #define MBED_DUMP_TRUCK_H
00003  
00004 #include "mbed.h"
00005 
00006 Serial pc(USBTX, USBRX);
00007 
00008 class DumpTruck {
00009 public:
00010     DumpTruck(int truckId);
00011     void drive(); // Drive DC motors with a desired motor speed and distance
00012     void RotateTo();
00013     void BedDown(); 
00014     void BedUp();   
00015     void raiseTo();
00016     void LowerBed();
00017     void stop();
00018     void Calibrate();
00019     
00020     
00021 protected:
00022     getBedAngle(); //Get data from Bed potentiometer, Hari is looking into the component for this
00023     getPivotAngle(double PivotAngle); //Get data from potentiometer
00024     SetPivotSpeed(double PivotSpeed); //Set arbitrary rotation of servo motor
00025     SetBedSpeed(); //Set arbitrary rotation of DC Motor
00026     float speed; //desired speed to drive the robot, a number between 0 and 1
00027     float distance; //input of desired distance to be traveled
00028     float setTruckSpeed(); // set user inputed truck speed
00029     float setTruckDistance(); //get user input for desired distance to be traveled
00030     bool GetBedUpperSwitch(); //Checks if bed is all the way up
00031     bool GetBedLowerSwitch(); //Checks if bed is all the way down
00032     bool SwitchState; //Switch state variable for Up and down bed functions
00033     float DesiredPivotAngle; // User Input of desired angle for the bed to be pivoted
00034     float DesiredBedAngle; //User Input of desired bed angle to be raised.
00035     float BedSpeed; //User input of desired speed for the dump truck's bed to rotate
00036     float PivotSpeed; //User input of desired speed for the dump truck to pivot its back at
00037     int truckNumber;
00038     bool isCalibrated;// returns 0 and 1 to check if the robot has been calibrated
00039 };
00040 
00041 #endif