hanya buat kamu B

Dependencies:   QEI mbed

Revision:
0:bb49b8e23b5d
Child:
1:d4e4fc0ee666
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Nov 05 09:56:54 2016 +0000
@@ -0,0 +1,21 @@
+#include "mbed.h"
+#include "QEI.h"
+
+QEI encoder( PA_3, PA_2, NC, 360, QEI::X4_ENCODING);
+
+Serial pc(USBTX,USBRX);
+
+int pulse;
+int rev;
+
+int main()
+{
+    pc.baud(115200);
+    
+    while(1)
+    {
+        pulse = encoder.getPulses();
+        rev   = encoder.getRevolutions();
+        pc.printf("%d Pulses\t\t%d Putaran\n", pulse, rev);    
+    }
+}
\ No newline at end of file