RotaryEncoder program only rotation speed.

Dependencies:   mbed

Revision:
0:6bbb8b1d5ead
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/encoder.cpp	Sun Feb 22 08:57:46 2015 +0000
@@ -0,0 +1,23 @@
+#include "mbed.h"
+Serial pc(USBTX,USBRX);
+InterruptIn encA(p6);
+/* 
+DigitalIn encA(p6);
+DigitalIn encB(p5);
+*/
+int Rota,count,n = 1;
+void counter(void){
+     count++;
+     if(count == 360*n){
+         Rota++;
+         n++;
+         pc.printf("%d\n",Rota);
+    }
+}
+int main() {
+    while(1){
+        pc.printf("www");
+        encA.rise(&counter);
+    }
+}
+ 
\ No newline at end of file