Interface to a standard tarco sensor. Measure the periode and the cal the speed
Counter.cpp@0:8421e11df32a, 2013-10-26 (annotated)
- Committer:
- gert_lauritsen
- Date:
- Sat Oct 26 15:31:36 2013 +0000
- Revision:
- 0:8421e11df32a
- Child:
- 1:f5d3c37b065e
sat et flow ind, s?ledes at man direkte kan f? det i liter
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gert_lauritsen | 0:8421e11df32a | 1 | #include "Counter.h" |
gert_lauritsen | 0:8421e11df32a | 2 | |
gert_lauritsen | 0:8421e11df32a | 3 | Counter::Counter(PinName flowsignal) : |
gert_lauritsen | 0:8421e11df32a | 4 | _flowsensor(flowsignal) { |
gert_lauritsen | 0:8421e11df32a | 5 | Count=0; |
gert_lauritsen | 0:8421e11df32a | 6 | _flowsensor.fall(this, &Counter::click); |
gert_lauritsen | 0:8421e11df32a | 7 | } |
gert_lauritsen | 0:8421e11df32a | 8 | |
gert_lauritsen | 0:8421e11df32a | 9 | void Counter::click() { |
gert_lauritsen | 0:8421e11df32a | 10 | Count++; |
gert_lauritsen | 0:8421e11df32a | 11 | } |
gert_lauritsen | 0:8421e11df32a | 12 | |
gert_lauritsen | 0:8421e11df32a | 13 | float Counter::Flow(){ |
gert_lauritsen | 0:8421e11df32a | 14 | return count /PulsPrLiter; |
gert_lauritsen | 0:8421e11df32a | 15 | } |
gert_lauritsen | 0:8421e11df32a | 16 |