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-02
Revision:
4:0d3a207680b0
Parent:
2:6bfef0839102
Child:
5:5bccf48799d4

File content as of revision 4:0d3a207680b0:

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

class PulsePin
{
    public:
        PulsePin(DigitalIn& pin, bool risingEdge, int pinStableTimeMs);
        bool Service();
        int GetLastCycleTimeMs();
    
    private:
        DigitalIn& _pin;
        Timer _pinTimer;
        bool _curPinState;
        bool _firstEdgeDetected;
        int _lastStableTimeMs;
        int _waitForPinStabilisationMs;
        bool _detectRisingEdge;
        int _timeBetweenEdgesMs;
};


#endif