Codeurs MECATRO

Dependencies:   mbed

Revision:
0:f462be86dc4a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/codeurs.h	Wed Mar 24 15:20:01 2021 +0000
@@ -0,0 +1,20 @@
+#ifndef _CODEURS_H
+#define _CODEURS_H
+
+#include "mbed.h"
+
+class Codeurs {
+    public:
+        Codeurs(PinName sda = D4, PinName scl = D5, int address = 0x20);
+        bool test();
+        void reset();
+        void read16(int16_t &gauche, int16_t &droit);
+        void read(int32_t &gauche, int32_t &droit);
+    private:
+        I2C _i2c;
+        int _address;
+        int32_t _gauche, _droit;
+        int16_t _g16, _d16;
+};
+
+#endif