Kommt ins Ziwl
Dependencies: mbed
Fork of Roboshark_V7 by
Diff: IRSensor.h
- Revision:
- 0:6d0671ae4648
- Child:
- 4:767fd282dd9c
diff -r 000000000000 -r 6d0671ae4648 IRSensor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/IRSensor.h Mon Apr 23 11:28:11 2018 +0000 @@ -0,0 +1,64 @@ +// Deklaration IR Sensoren +// V04.18 +// V. Ahlers + + +#ifndef IRSENSOR_H_ +#define IRSENSOR_H_ + +#include <cstdlib> +#include <mbed.h> + + class IRSensor { + + public: + IRSensor(AnalogIn& IrRight, AnalogIn& IrLeft, AnalogIn& IrFront, float dis2R, float dis2L, float dis2F); + + float disR; + float disL; + float disF; + int IrR; + int IrL; + int IrF; + + float measR; + float measL; + float measF; + + virtual ~IRSensor(); + float readR(); + float readL(); + float readF(); + int codeR(); + int codeL(); + int codeF(); + + private: + AnalogIn& IrRight; + AnalogIn& IrLeft; + AnalogIn& IrFront; + float dis2R; + float dis2L; + float dis2F; + static const float PR1; + static const float PR2; + static const float PR3; + static const float PR4; + static const float PR5; + static const float PL1; + static const float PL2; + static const float PL3; + static const float PL4; + static const float PL5; + static const float PF1; + static const float PF2; + static const float PF3; + static const float PF4; + static const float PF5; + static const int minIrR; + static const int minIrL; + static const int minIrF; + +}; + +#endif /*IRSensor_H_*/