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

PulsePin.h

Committer:
Bobty
Date:
2015-02-17
Revision:
5:5bccf48799d4
Parent:
4:0d3a207680b0

File content as of revision 5:5bccf48799d4:

#ifndef __PULSEPIN__H
#define __PULSEPIN__H
#include "mbed.h"

class PulsePin
{
    public:
        PulsePin(DigitalIn& pin, bool risingEdge, int pinStableTimeMs);
        bool Service();
        int GetPulseRateMs();
        int GetPulseCount();
        void SetPulseCount(int pulseCount);

    private:
        DigitalIn& _pin;
        Timer _pinTimer;
        bool _curPinState;
        bool _firstEdgeDetected;
        int _lastStableTimeMs;
        int _waitForPinStabilisationMs;
        bool _detectRisingEdge;
        int _timeBetweenEdgesMs;
        int _pulseCount;
        int _pinTimerMinutes;
};


#endif