Interface to a standard tarco sensor. Measure the periode and the cal the speed

Counter.cpp

Committer:
gert_lauritsen
Date:
2013-10-27
Revision:
1:f5d3c37b065e
Parent:
0:8421e11df32a

File content as of revision 1:f5d3c37b065e:

#include "Counter.h"

Counter::Counter(PinName flowsignal) :
    _flowsensor(flowsignal) {
        Count=0;
        _flowsensor.fall(this, &Counter::click);
}

void Counter::click() {
 Count++;
}

float Counter::Flow(){
 return (float) Count/PulsPrLiter;
}