Counter
Dependencies: EthernetInterface NTPClient SDFileSystem TextLCD WebSocketClient mbed-rtos mbed Socket lwip-eth lwip-sys lwip FATFileSystem
Diff: Counter/Counter.cpp
- Revision:
- 0:ecaf3e593122
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Counter/Counter.cpp Mon Feb 29 18:59:15 2016 +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 (float) Count/PulsPrLiter; +} +