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.
Dependencies: EthernetInterfacePlusHostname NTPClient Onewire RdWebServer SDFileSystem-RTOS mbed-rtos mbed-src
PulsePin.h@22:14b4060dd027, 2015-10-16 (annotated)
- Committer:
- Bobty
- Date:
- Fri Oct 16 08:42:13 2015 +0000
- Revision:
- 22:14b4060dd027
- Parent:
- 5:5bccf48799d4
Re-enabled web folder view on server
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Bobty | 2:6bfef0839102 | 1 | #ifndef __PULSEPIN__H |
| Bobty | 2:6bfef0839102 | 2 | #define __PULSEPIN__H |
| Bobty | 2:6bfef0839102 | 3 | #include "mbed.h" |
| Bobty | 2:6bfef0839102 | 4 | |
| Bobty | 2:6bfef0839102 | 5 | class PulsePin |
| Bobty | 2:6bfef0839102 | 6 | { |
| Bobty | 2:6bfef0839102 | 7 | public: |
| Bobty | 2:6bfef0839102 | 8 | PulsePin(DigitalIn& pin, bool risingEdge, int pinStableTimeMs); |
| Bobty | 2:6bfef0839102 | 9 | bool Service(); |
| Bobty | 5:5bccf48799d4 | 10 | int GetPulseRateMs(); |
| Bobty | 5:5bccf48799d4 | 11 | int GetPulseCount(); |
| Bobty | 5:5bccf48799d4 | 12 | void SetPulseCount(int pulseCount); |
| Bobty | 5:5bccf48799d4 | 13 | |
| Bobty | 2:6bfef0839102 | 14 | private: |
| Bobty | 2:6bfef0839102 | 15 | DigitalIn& _pin; |
| Bobty | 2:6bfef0839102 | 16 | Timer _pinTimer; |
| Bobty | 2:6bfef0839102 | 17 | bool _curPinState; |
| Bobty | 2:6bfef0839102 | 18 | bool _firstEdgeDetected; |
| Bobty | 2:6bfef0839102 | 19 | int _lastStableTimeMs; |
| Bobty | 2:6bfef0839102 | 20 | int _waitForPinStabilisationMs; |
| Bobty | 4:0d3a207680b0 | 21 | bool _detectRisingEdge; |
| Bobty | 2:6bfef0839102 | 22 | int _timeBetweenEdgesMs; |
| Bobty | 5:5bccf48799d4 | 23 | int _pulseCount; |
| Bobty | 5:5bccf48799d4 | 24 | int _pinTimerMinutes; |
| Bobty | 2:6bfef0839102 | 25 | }; |
| Bobty | 2:6bfef0839102 | 26 | |
| Bobty | 2:6bfef0839102 | 27 | |
| Bobty | 2:6bfef0839102 | 28 | #endif |