![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
vf
Dependencies: Servo ServoArm mbed
Fork of PES_Official by
Diff: Headers/Robot.h
- Revision:
- 10:f76476943a6c
- Parent:
- 6:ba26dd3251b3
- Child:
- 11:292bdbd85a9c
--- a/Headers/Robot.h Tue May 02 08:00:19 2017 +0000 +++ b/Headers/Robot.h Wed May 03 13:54:51 2017 +0000 @@ -4,6 +4,7 @@ #include <cstdlib> #include <mbed.h> #include "Servo.h" +#include "ServoArm.h" #include "mbed.h" @@ -59,9 +60,9 @@ public: Arm(); - Arm(Servo* servoArm); + Arm(ServoArm* servoArm); - void init(Servo* servoArm); + void init(ServoArm* servoArm); void collecttodown(int* done); void downtocollect(int* done); @@ -69,18 +70,35 @@ void backtocollect(int* done); private: - Servo* servoArm; + ServoArm* arm; float angle; }; +class Greifer +{ + + public: + + Greifer(Servo* greifer); + Greifer(); + + void init(Servo* greifer); + void take(); + void leave(); + + private: + Servo* greifer; + +}; + class Robot { public: //Robot related: - Robot(PwmOut* left, PwmOut* right, DigitalOut* enableSignal, DigitalOut* leds, AnalogIn* FarbVoltage, AnalogIn* frontS, AnalogIn* leftS, AnalogIn* rightS, Servo* Arm ); + Robot(PwmOut* left, PwmOut* right, DigitalOut* powerSignal, DigitalOut* leds, AnalogIn* FarbVoltage, AnalogIn* frontS, AnalogIn* leftS, AnalogIn* rightS, ServoArm* Arm, Servo* Greifer ); //Drive Functions void drive(); @@ -106,7 +124,8 @@ void nothingFound(int* counter, int* timer, int* lastAct); void search(int* counter, int* timer, int* found); - void lego(int* counter, Timer* t); + + int getErrorMotor(); //DistanceSensors related: DistanceSensors sensors[9]; @@ -127,19 +146,22 @@ //Arm related: Arm Arm; + //Greifer related: + Greifer Greifer; + private: //Robot related: PwmOut* left; PwmOut* right; + DigitalIn* errorMotor; DigitalOut* powerSignal; DigitalIn* errorSignal; DigitalIn* overtemperatur; - Servo* arm; - - + Servo* greifer; + ServoArm* arm; }; #endif \ No newline at end of file