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.
Sensor/DistanceSensor.h@0:64fe0ebc42c6, 2020-11-11 (annotated)
- Committer:
- yeongsookim
- Date:
- Wed Nov 11 22:04:30 2020 +0000
- Revision:
- 0:64fe0ebc42c6
distance sensor
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| yeongsookim | 0:64fe0ebc42c6 | 1 | #ifndef MBED_DISTANCESENSOR_H |
| yeongsookim | 0:64fe0ebc42c6 | 2 | #define MBED_DISTANCESENSOR_H |
| yeongsookim | 0:64fe0ebc42c6 | 3 | |
| yeongsookim | 0:64fe0ebc42c6 | 4 | #include "mbed.h" |
| yeongsookim | 0:64fe0ebc42c6 | 5 | |
| yeongsookim | 0:64fe0ebc42c6 | 6 | class DistanceSensor |
| yeongsookim | 0:64fe0ebc42c6 | 7 | { |
| yeongsookim | 0:64fe0ebc42c6 | 8 | public: |
| yeongsookim | 0:64fe0ebc42c6 | 9 | DistanceSensor(PinName a); |
| yeongsookim | 0:64fe0ebc42c6 | 10 | float getDistance_cm(); |
| yeongsookim | 0:64fe0ebc42c6 | 11 | |
| yeongsookim | 0:64fe0ebc42c6 | 12 | protected: |
| yeongsookim | 0:64fe0ebc42c6 | 13 | float m_distance; |
| yeongsookim | 0:64fe0ebc42c6 | 14 | AnalogIn m_analogIn; |
| yeongsookim | 0:64fe0ebc42c6 | 15 | |
| yeongsookim | 0:64fe0ebc42c6 | 16 | }; |
| yeongsookim | 0:64fe0ebc42c6 | 17 | |
| yeongsookim | 0:64fe0ebc42c6 | 18 | #endif //MBED_DISTANCESENSOR_H |