Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
IRSensor.h@1:3396e2b3a62b, 2018-04-20 (annotated)
- Committer:
- ahlervin
- Date:
- Fri Apr 20 09:16:34 2018 +0000
- Revision:
- 1:3396e2b3a62b
- Parent:
- 0:608fcd3255ca
Sensoren auslesen 2
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| ahlervin | 0:608fcd3255ca | 1 | |
| ahlervin | 0:608fcd3255ca | 2 | // Deklaration IR Sensoren |
| ahlervin | 0:608fcd3255ca | 3 | // V04.18 |
| ahlervin | 0:608fcd3255ca | 4 | // V. Ahlers |
| ahlervin | 0:608fcd3255ca | 5 | |
| ahlervin | 0:608fcd3255ca | 6 | |
| ahlervin | 0:608fcd3255ca | 7 | #ifndef IRSENSOR_H_ |
| ahlervin | 0:608fcd3255ca | 8 | #define IRSENSOR_H_ |
| ahlervin | 0:608fcd3255ca | 9 | |
| ahlervin | 0:608fcd3255ca | 10 | #include <cstdlib> |
| ahlervin | 0:608fcd3255ca | 11 | #include <mbed.h> |
| ahlervin | 0:608fcd3255ca | 12 | |
| ahlervin | 0:608fcd3255ca | 13 | class IRSensor { |
| ahlervin | 0:608fcd3255ca | 14 | |
| ahlervin | 0:608fcd3255ca | 15 | public: |
| ahlervin | 1:3396e2b3a62b | 16 | IRSensor(AnalogIn& IrRight, AnalogIn& IrLeft, AnalogIn& IrFront); |
| ahlervin | 0:608fcd3255ca | 17 | |
| ahlervin | 0:608fcd3255ca | 18 | float disR; |
| ahlervin | 0:608fcd3255ca | 19 | float disL; |
| ahlervin | 0:608fcd3255ca | 20 | float disF; |
| ahlervin | 0:608fcd3255ca | 21 | |
| ahlervin | 0:608fcd3255ca | 22 | float measR; |
| ahlervin | 0:608fcd3255ca | 23 | float measL; |
| ahlervin | 0:608fcd3255ca | 24 | float measF; |
| ahlervin | 0:608fcd3255ca | 25 | |
| ahlervin | 0:608fcd3255ca | 26 | virtual ~IRSensor(); |
| ahlervin | 0:608fcd3255ca | 27 | float readR(); |
| ahlervin | 0:608fcd3255ca | 28 | float readL(); |
| ahlervin | 0:608fcd3255ca | 29 | float readF(); |
| ahlervin | 0:608fcd3255ca | 30 | |
| ahlervin | 0:608fcd3255ca | 31 | private: |
| ahlervin | 0:608fcd3255ca | 32 | AnalogIn& IrRight; |
| ahlervin | 0:608fcd3255ca | 33 | AnalogIn& IrLeft; |
| ahlervin | 0:608fcd3255ca | 34 | AnalogIn& IrFront; |
| ahlervin | 0:608fcd3255ca | 35 | static const float PR1; |
| ahlervin | 0:608fcd3255ca | 36 | static const float PR2; |
| ahlervin | 0:608fcd3255ca | 37 | static const float PR3; |
| ahlervin | 0:608fcd3255ca | 38 | static const float PR4; |
| ahlervin | 0:608fcd3255ca | 39 | static const float PR5; |
| ahlervin | 0:608fcd3255ca | 40 | static const float PL1; |
| ahlervin | 0:608fcd3255ca | 41 | static const float PL2; |
| ahlervin | 0:608fcd3255ca | 42 | static const float PL3; |
| ahlervin | 0:608fcd3255ca | 43 | static const float PL4; |
| ahlervin | 0:608fcd3255ca | 44 | static const float PL5; |
| ahlervin | 0:608fcd3255ca | 45 | static const float PF1; |
| ahlervin | 0:608fcd3255ca | 46 | static const float PF2; |
| ahlervin | 0:608fcd3255ca | 47 | static const float PF3; |
| ahlervin | 0:608fcd3255ca | 48 | static const float PF4; |
| ahlervin | 0:608fcd3255ca | 49 | static const float PF5; |
| ahlervin | 0:608fcd3255ca | 50 | |
| ahlervin | 0:608fcd3255ca | 51 | }; |
| ahlervin | 0:608fcd3255ca | 52 | |
| ahlervin | 0:608fcd3255ca | 53 | #endif /*IR_H_*/ |