syouichi imamori
/
MulticopterQuadX
Quad X Type Multicopter
PulseWidthCounter/PulseWidthCounter.h@8:1db19b529b22, 2021-02-21 (annotated)
- Committer:
- komaida424
- Date:
- Sun Feb 21 05:14:57 2021 +0000
- Revision:
- 8:1db19b529b22
- Parent:
- 2:59ac9df97701
rev 020
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 | 8:1db19b529b22 | 14 | InterruptIn pulsein; |
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 | 8:1db19b529b22 | 19 | PulseWidthCounter(const PulseWidthCounter& pwc); |
komaida424 | 2:59ac9df97701 | 20 | int count; |
komaida424 | 2:59ac9df97701 | 21 | }; |
komaida424 | 2:59ac9df97701 | 22 | #endif |