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.
PulseWidthCounter/PulseWidthCounter.h@2:59ac9df97701, 2013-11-15 (annotated)
- Committer:
- komaida424
- Date:
- Fri Nov 15 20:53:36 2013 +0000
- Revision:
- 2:59ac9df97701
- Child:
- 8:1db19b529b22
ver.1.25
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| komaida424 | 2:59ac9df97701 | 1 | #ifndef PULSEWIDTHCOUNTER_H |
| komaida424 | 2:59ac9df97701 | 2 | #define PULSEWIDTHCOUNTER_H |
| komaida424 | 2:59ac9df97701 | 3 | #define POSITIVE true |
| komaida424 | 2:59ac9df97701 | 4 | #define NEGATIVE false |
| komaida424 | 2:59ac9df97701 | 5 | |
| komaida424 | 2:59ac9df97701 | 6 | #include "mbed.h" |
| komaida424 | 2:59ac9df97701 | 7 | |
| komaida424 | 2:59ac9df97701 | 8 | class PulseWidthCounter |
| komaida424 | 2:59ac9df97701 | 9 | { |
| komaida424 | 2:59ac9df97701 | 10 | private: |
| komaida424 | 2:59ac9df97701 | 11 | Timer _time; |
| komaida424 | 2:59ac9df97701 | 12 | void start(); |
| komaida424 | 2:59ac9df97701 | 13 | void stop(); |
| komaida424 | 2:59ac9df97701 | 14 | InterruptIn interrupt; |
| komaida424 | 2:59ac9df97701 | 15 | |
| komaida424 | 2:59ac9df97701 | 16 | public: |
| komaida424 | 2:59ac9df97701 | 17 | // Timer time; |
| komaida424 | 2:59ac9df97701 | 18 | PulseWidthCounter(PinName,bool positive=true); |
| komaida424 | 2:59ac9df97701 | 19 | |
| komaida424 | 2:59ac9df97701 | 20 | int count; |
| komaida424 | 2:59ac9df97701 | 21 | }; |
| komaida424 | 2:59ac9df97701 | 22 | #endif |