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/HallSensor.h@0:c88a81d07287, 2019-11-06 (annotated)
- Committer:
- yeongsookim
- Date:
- Wed Nov 06 01:17:46 2019 +0000
- Revision:
- 0:c88a81d07287
First commit
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| yeongsookim | 0:c88a81d07287 | 1 | #ifndef MBED_HallSensor_H |
| yeongsookim | 0:c88a81d07287 | 2 | #define MBED_HallSensor_H |
| yeongsookim | 0:c88a81d07287 | 3 | |
| yeongsookim | 0:c88a81d07287 | 4 | #include "mbed.h" |
| yeongsookim | 0:c88a81d07287 | 5 | |
| yeongsookim | 0:c88a81d07287 | 6 | #define PI 3.141592 |
| yeongsookim | 0:c88a81d07287 | 7 | |
| yeongsookim | 0:c88a81d07287 | 8 | |
| yeongsookim | 0:c88a81d07287 | 9 | class HallSensor |
| yeongsookim | 0:c88a81d07287 | 10 | { |
| yeongsookim | 0:c88a81d07287 | 11 | public: |
| yeongsookim | 0:c88a81d07287 | 12 | HallSensor(PinName a); |
| yeongsookim | 0:c88a81d07287 | 13 | |
| yeongsookim | 0:c88a81d07287 | 14 | int getPinState (); |
| yeongsookim | 0:c88a81d07287 | 15 | float getSpeed_rps(); |
| yeongsookim | 0:c88a81d07287 | 16 | |
| yeongsookim | 0:c88a81d07287 | 17 | protected: |
| yeongsookim | 0:c88a81d07287 | 18 | void risingCallback(); |
| yeongsookim | 0:c88a81d07287 | 19 | |
| yeongsookim | 0:c88a81d07287 | 20 | InterruptIn m_hallSensor; |
| yeongsookim | 0:c88a81d07287 | 21 | Timer m_timer_sec; |
| yeongsookim | 0:c88a81d07287 | 22 | float m_period_sec; |
| yeongsookim | 0:c88a81d07287 | 23 | }; |
| yeongsookim | 0:c88a81d07287 | 24 | |
| yeongsookim | 0:c88a81d07287 | 25 | #endif |