a
Dependencies: Servo ServoArm mbed
Fork of PES_Official-TestF by
Diff: Headers/Robot.h
- Revision:
- 17:4e1be70bdedb
- Parent:
- 15:915f8839fe48
--- a/Headers/Robot.h Thu May 11 18:57:45 2017 +0000 +++ b/Headers/Robot.h Thu May 18 14:27:09 2017 +0000 @@ -5,6 +5,7 @@ #include <mbed.h> #include "Servo.h" #include "ServoArm.h" +#include <Ultraschall.h> #include "mbed.h" @@ -52,7 +53,7 @@ private: - AnalogIn* FarbVoltage; + AnalogIn* FarbVoltage; }; class Arm{ @@ -84,8 +85,8 @@ void init(Servo* servoLeiste); - int UpToDown(); - int DownToUp(); + int upToDown(); + int downToUp(); private: @@ -112,13 +113,27 @@ }; +class USsensor +{ + public: + + USsensor(); + USsensor(Ultraschall* Usensor); + void init(Ultraschall* Usensor); + float read(); + operator float(); + + private: + Ultraschall* Usensor; +}; + class Robot { public: //Robot related: - Robot(PwmOut* left, PwmOut* right, DigitalOut* powerSignal, DigitalOut* leds, AnalogIn* FarbVoltage, AnalogIn* frontS, AnalogIn* leftS, AnalogIn* rightS, ServoArm* Arm, Servo* Greifer, Servo* Leiste ); + Robot(PwmOut* left, PwmOut* right, DigitalOut* powerSignal, DigitalOut* leds, AnalogIn* FarbVoltage, AnalogIn* frontS, AnalogIn* leftS, AnalogIn* rightS, ServoArm* Arm, Servo* Greifer, Servo* Leiste, Ultraschall* USsensor ); //Drive Functions void drive(); @@ -132,6 +147,8 @@ void stop(); //Functions that use the drive functions + void driveSlowly(); + void driveBackSlowly();/* void wallRight(int* counter, int* timer, int* lastAct); void wallLeft(int* counter, int* timer, int* lastAct); void wallFront(int* counter, int* timer, int* lastAct); @@ -142,13 +159,15 @@ void legoLeft(int* counter, int* timer, int* lastAct, int* legoFound); void nothingFound(int* counter, int* timer, int* lastAct); - + */ int search(int* timer); + float see(int sensor); int getErrorMotor(); //DistanceSensors related: DistanceSensors sensors[9]; + USsensor USsensor; AnalogIn* frontS; AnalogIn* leftS; AnalogIn* rightS; @@ -162,6 +181,7 @@ //Farbsensors related: Farbsensor FarbVoltage; + DigitalOut* led; //Arm related: Arm Arm;