Interface to a standard tarco sensor. Measure the periode and the cal the speed
Diff: Counter.cpp
- Revision:
- 0:8421e11df32a
- Child:
- 1:f5d3c37b065e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Counter.cpp Sat Oct 26 15:31:36 2013 +0000 @@ -0,0 +1,16 @@ +#include "Counter.h" + +Counter::Counter(PinName flowsignal) : + _flowsensor(flowsignal) { + Count=0; + _flowsensor.fall(this, &Counter::click); +} + +void Counter::click() { + Count++; +} + +float Counter::Flow(){ + return count /PulsPrLiter; +} +