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-10-16
Revision:
23:fd5a5a9f30bc
Parent:
5:5bccf48799d4

File content as of revision 23:fd5a5a9f30bc:

#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