ちょっとかえた

Fork of encoder by ケンタ ミヤザキ

Revision:
0:0d6f91c4a794
Child:
1:6456080fa03b
diff -r 000000000000 -r 0d6f91c4a794 encoder.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/encoder.h	Thu Mar 22 05:55:17 2018 +0000
@@ -0,0 +1,22 @@
+#ifndef ENCODER_H
+#define ENCODER_H
+
+#include "mbed.h"
+
+class Encoder{
+public  :
+    Encoder(PinName APin, PinName BPin, PinName ZPin);
+    float read_rotate();
+    int read_z();
+    void init();
+private :
+    InterruptIn A;
+    DigitalIn B;
+    DigitalIn Z;
+    int count;
+    int zcount;
+    void flag();
+};
+
+#endif
+