Sensoren auslesen/umwandeln/codieren und State Maschine
Dependencies: mbed
Fork of StateMachine_1 by
IRSensor.h@4:91a9737e4821, 2018-04-20 (annotated)
- Committer:
- ahlervin
- Date:
- Fri Apr 20 17:49:36 2018 +0000
- Revision:
- 4:91a9737e4821
Sensoren auswerten, Codieren und State Machine
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ahlervin | 4:91a9737e4821 | 1 | // Deklaration IR Sensoren |
ahlervin | 4:91a9737e4821 | 2 | // V04.18 |
ahlervin | 4:91a9737e4821 | 3 | // V. Ahlers |
ahlervin | 4:91a9737e4821 | 4 | |
ahlervin | 4:91a9737e4821 | 5 | |
ahlervin | 4:91a9737e4821 | 6 | #ifndef IRSENSOR_H_ |
ahlervin | 4:91a9737e4821 | 7 | #define IRSENSOR_H_ |
ahlervin | 4:91a9737e4821 | 8 | |
ahlervin | 4:91a9737e4821 | 9 | #include <cstdlib> |
ahlervin | 4:91a9737e4821 | 10 | #include <mbed.h> |
ahlervin | 4:91a9737e4821 | 11 | |
ahlervin | 4:91a9737e4821 | 12 | class IRSensor { |
ahlervin | 4:91a9737e4821 | 13 | |
ahlervin | 4:91a9737e4821 | 14 | public: |
ahlervin | 4:91a9737e4821 | 15 | IRSensor(AnalogIn& IrRight, AnalogIn& IrLeft, AnalogIn& IrFront, float dis2R, float dis2L, float dis2F); |
ahlervin | 4:91a9737e4821 | 16 | |
ahlervin | 4:91a9737e4821 | 17 | float disR; |
ahlervin | 4:91a9737e4821 | 18 | float disL; |
ahlervin | 4:91a9737e4821 | 19 | float disF; |
ahlervin | 4:91a9737e4821 | 20 | int IrR; |
ahlervin | 4:91a9737e4821 | 21 | int IrL; |
ahlervin | 4:91a9737e4821 | 22 | int IrF; |
ahlervin | 4:91a9737e4821 | 23 | |
ahlervin | 4:91a9737e4821 | 24 | float measR; |
ahlervin | 4:91a9737e4821 | 25 | float measL; |
ahlervin | 4:91a9737e4821 | 26 | float measF; |
ahlervin | 4:91a9737e4821 | 27 | |
ahlervin | 4:91a9737e4821 | 28 | virtual ~IRSensor(); |
ahlervin | 4:91a9737e4821 | 29 | float readR(); |
ahlervin | 4:91a9737e4821 | 30 | float readL(); |
ahlervin | 4:91a9737e4821 | 31 | float readF(); |
ahlervin | 4:91a9737e4821 | 32 | int codeR(); |
ahlervin | 4:91a9737e4821 | 33 | int codeL(); |
ahlervin | 4:91a9737e4821 | 34 | int codeF(); |
ahlervin | 4:91a9737e4821 | 35 | |
ahlervin | 4:91a9737e4821 | 36 | private: |
ahlervin | 4:91a9737e4821 | 37 | AnalogIn& IrRight; |
ahlervin | 4:91a9737e4821 | 38 | AnalogIn& IrLeft; |
ahlervin | 4:91a9737e4821 | 39 | AnalogIn& IrFront; |
ahlervin | 4:91a9737e4821 | 40 | float dis2R; |
ahlervin | 4:91a9737e4821 | 41 | float dis2L; |
ahlervin | 4:91a9737e4821 | 42 | float dis2F; |
ahlervin | 4:91a9737e4821 | 43 | static const float PR1; |
ahlervin | 4:91a9737e4821 | 44 | static const float PR2; |
ahlervin | 4:91a9737e4821 | 45 | static const float PR3; |
ahlervin | 4:91a9737e4821 | 46 | static const float PR4; |
ahlervin | 4:91a9737e4821 | 47 | static const float PR5; |
ahlervin | 4:91a9737e4821 | 48 | static const float PL1; |
ahlervin | 4:91a9737e4821 | 49 | static const float PL2; |
ahlervin | 4:91a9737e4821 | 50 | static const float PL3; |
ahlervin | 4:91a9737e4821 | 51 | static const float PL4; |
ahlervin | 4:91a9737e4821 | 52 | static const float PL5; |
ahlervin | 4:91a9737e4821 | 53 | static const float PF1; |
ahlervin | 4:91a9737e4821 | 54 | static const float PF2; |
ahlervin | 4:91a9737e4821 | 55 | static const float PF3; |
ahlervin | 4:91a9737e4821 | 56 | static const float PF4; |
ahlervin | 4:91a9737e4821 | 57 | static const float PF5; |
ahlervin | 4:91a9737e4821 | 58 | static const int minIrR; |
ahlervin | 4:91a9737e4821 | 59 | static const int minIrL; |
ahlervin | 4:91a9737e4821 | 60 | static const int minIrF; |
ahlervin | 4:91a9737e4821 | 61 | |
ahlervin | 4:91a9737e4821 | 62 | }; |
ahlervin | 4:91a9737e4821 | 63 | |
ahlervin | 4:91a9737e4821 | 64 | #endif /*IRSensor_H_*/ |