Mechatronics Robotics
/
BrobotV1
These are the core files for the Robot at Team conception.
Brobot.h
- Committer:
- Paulhd182
- Date:
- 2017-06-01
- Revision:
- 12:9a763d149f61
- Parent:
- 11:05d5539141c8
File content as of revision 12:9a763d149f61:
/* * Brobot.h * */ #ifndef BROBOT_H_ #define BROBOT_H_ #include <cstdlib> #include <mbed.h> #include "SpeedControl.h" #include "PID_Control.h" #include "IRSensor.h" #include "Pixy.h" /** * This is a device driver class to drive the robot autonomously */ class Brobot { public: // constructors have same name as the class Brobot(SpeedControl& speedctrl, AnalogIn& distance, DigitalOut& enable, DigitalOut& bit0, DigitalOut& bit1, DigitalOut& bit2, DigitalOut* leds, Pixy& pixy); void avoidObstacleAndMove(int vtrans); void startLeds(); void ledShow(); void ledDistance(); void turnleft(); void turnright(); void forward(); void back(); void stop(); void rotate(int ammount); // void approachBrick(); void approachHome(); ////////////////////// new line void closeGrip(); void openGrip(); bool foundGreenBrick(); bool foundHome(); private: IRSensor sensor_front; // uses the default constructor because no arguments given IRSensor sensor_left; IRSensor sensor_right; DigitalOut* leds; //0 to 5 IRSensor sensors[6]; Ticker t1; PID_Control pid; PID_Control pixypid; Pixy pixy; SpeedControl& speedctrl; AnalogIn& distance; DigitalOut& enable; DigitalOut& bit0; DigitalOut& bit1; DigitalOut& bit2; }; #endif /* BROBOT_H_ */