test program

Dependencies:   LSM9DS1_Library2 MotorV2 SRF05 Tracker2 mbed nRF24L01P

Fork of DUMP_TRUCK_SPR2017 by Terrabots

DumpTruck.h

Committer:
simplyellow
Date:
2017-02-23
Revision:
9:5a35e2a28a47
Parent:
5:dc4cf6cc24b3

File content as of revision 9:5a35e2a28a47:

#ifndef MBED_DUMP_TRUCK_H
#define MBED_DUMP_TRUCK_H

#include "mbed.h"
#include "Tracker.h"
#include "IMU.h"
#include "Motor.h"
#include "Transceiver.h"

// ADD SWITCHES & ULTRASONIC SENSOR implementation

class DumpTruck {
public:
    DumpTruck(int truckId);

    // motor functions
    void drive(float speed, float distance);// frontMotor
    void turn(float angle);                 // turnMotor
    void moveBed(bool raise, float angle);  // bedMotor
    void stop();                            // all Motors

    // ultrasonic functions
    bool detect();                          // returns bool for object too close


protected:
    Tracker *track;
    IMU *bed;
    Motor *frontMotor;
    Motor *turnMotor;
    Motor *bedMotor;
    Transceiver *nrf;

    // add direct control for motor, switch, and ultrasonic sensor.

    int truckNumber;

    // motor variables
    float speed;                            // drive
    float distance;                         // drive
    float potAngle;                         // turn
    float bedAngle;                         // bed

    // bed-specific variables
    bool switchState;   // BusIn the two limit switches

    // ultrasonic-specific variables
    bool tooClose;
    float proximity
};
#endif