Rob Dobson / RdGasUseMonitor

Dependencies:   EthernetInterfacePlusHostname NTPClient Onewire RdWebServer SDFileSystem-RTOS mbed-rtos mbed-src

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?

UserRevisionLine numberNew 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