Monitor for central heating system (e.g. 2zones+hw) Supports up to 15 temp probes (DS18B20/DS18S20) 3 valve monitors Gas pulse meter recording Use stand-alone or with nodeEnergyServer See http://robdobson.com/2015/09/central-heating-monitor

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

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers PulsePin.h Source File

PulsePin.h

00001 #ifndef __PULSEPIN__H
00002 #define __PULSEPIN__H
00003 #include "mbed.h"
00004 
00005 class PulsePin
00006 {
00007     public:
00008         PulsePin(DigitalIn& pin, bool risingEdge, int pinStableTimeMs);
00009         bool Service();
00010         int GetPulseRateMs();
00011         int GetPulseCount();
00012         void SetPulseCount(int pulseCount);
00013 
00014     private:
00015         DigitalIn& _pin;
00016         Timer _pinTimer;
00017         bool _curPinState;
00018         bool _firstEdgeDetected;
00019         int _lastStableTimeMs;
00020         int _waitForPinStabilisationMs;
00021         bool _detectRisingEdge;
00022         int _timeBetweenEdgesMs;
00023         int _pulseCount;
00024         int _pinTimerMinutes;
00025 };
00026 
00027 
00028 #endif