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.
irpair.h@44:85bf2c0cd518, 2017-06-02 (annotated)
- Committer:
- christine222
- Date:
- Fri Jun 02 18:50:51 2017 +0000
- Revision:
- 44:85bf2c0cd518
- Parent:
- 33:68ce1f74ab5f
rngesus
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| kyleliangus | 6:3d68fedd6fd9 | 1 | #ifndef IRPAIR_H |
| kyleliangus | 6:3d68fedd6fd9 | 2 | #define IRPAIR_H |
| kyleliangus | 6:3d68fedd6fd9 | 3 | |
| kyleliangus | 6:3d68fedd6fd9 | 4 | #include "mbed.h" |
| kyleliangus | 6:3d68fedd6fd9 | 5 | |
| kyleliangus | 6:3d68fedd6fd9 | 6 | #define samplesToTake 1000 |
| kyleliangus | 6:3d68fedd6fd9 | 7 | |
| kyleliangus | 6:3d68fedd6fd9 | 8 | class IRPair |
| kyleliangus | 6:3d68fedd6fd9 | 9 | { |
| kyleliangus | 6:3d68fedd6fd9 | 10 | public: |
| kyleliangus | 6:3d68fedd6fd9 | 11 | IRPair( PinName pin, PinName rec ) : ir( pin ), recv( rec ) |
| kyleliangus | 6:3d68fedd6fd9 | 12 | { |
| kyleliangus | 6:3d68fedd6fd9 | 13 | calibrateSensor(); |
| kyleliangus | 6:3d68fedd6fd9 | 14 | } |
| kyleliangus | 6:3d68fedd6fd9 | 15 | |
| sahilmgandhi | 33:68ce1f74ab5f | 16 | double getSamples( int samples ); |
| kyleliangus | 6:3d68fedd6fd9 | 17 | |
| kyleliangus | 9:1d8e4da058cd | 18 | float sensorAvg; |
| christine222 | 24:e7063765d6f0 | 19 | void calibrateSensor(); |
| kyleliangus | 9:1d8e4da058cd | 20 | |
| kyleliangus | 6:3d68fedd6fd9 | 21 | private: |
| christine222 | 24:e7063765d6f0 | 22 | |
| kyleliangus | 6:3d68fedd6fd9 | 23 | |
| kyleliangus | 6:3d68fedd6fd9 | 24 | // internal values |
| kyleliangus | 6:3d68fedd6fd9 | 25 | DigitalOut ir; |
| kyleliangus | 6:3d68fedd6fd9 | 26 | AnalogIn recv; |
| kyleliangus | 9:1d8e4da058cd | 27 | |
| kyleliangus | 6:3d68fedd6fd9 | 28 | }; |
| kyleliangus | 6:3d68fedd6fd9 | 29 | |
| kyleliangus | 6:3d68fedd6fd9 | 30 | |
| kyleliangus | 6:3d68fedd6fd9 | 31 | |
| kyleliangus | 6:3d68fedd6fd9 | 32 | #endif |