testing encoder without function

Dependencies:   mbed

Revision:
0:e180c98a3437
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/encoder.cpp	Mon Nov 01 15:39:50 2021 +0000
@@ -0,0 +1,20 @@
+#include "mbed.h"
+#include "QEI.h"
+
+QEI encoder (A0,A1,NC,2500);
+Serial pc(USBTX, USBRX);
+int counter = 0;
+int cur_state = 0;
+
+int main(void) {  
+        while(1){
+        counter = counter++;
+        if( counter > cur_state){
+            cur_state = counter;
+            printf("%d ", cur_state);
+            }else if(counter < cur_state){
+                cur_state = counter;
+                printf("%d ", cur_state);
+                }                
+        }
+}
\ No newline at end of file