David Lloyd / Mbed 2 deprecated SF800_flowmeter

Dependencies:   mbed

Revision:
0:be447af0921d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/counter/counter.cpp	Fri Nov 25 14:32:50 2011 +0000
@@ -0,0 +1,31 @@
+/*
+ * Based on Aaron Berk's library for a QEI (http://mbed.org/users/aberk/libraries/QEI/le4bkf), this mainly involved deleting most of the functionality
+ *
+ * Includes
+ */
+#include "counter.h"
+
+counter::counter(PinName channelA) : channelA_(channelA){
+
+    pulses_       = 0;
+    channelA_.rise(this, &counter::encode);
+    
+}
+
+void counter::reset(void) {
+
+    pulses_      = 0;
+    
+}
+
+int counter::getPulses(void) {
+
+    return pulses_;
+
+}
+
+void counter::encode(void) {
+
+    pulses_++;
+    
+}
\ No newline at end of file