Kobayashi Akihiro / ActiveCaster

Dependents:   ActiveCaster_ ActiveCaster_2

Revision:
0:5e4f1e288e2a
diff -r 000000000000 -r 5e4f1e288e2a LpmsMe1Peach.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LpmsMe1Peach.h	Mon Jan 24 03:12:54 2022 +0000
@@ -0,0 +1,31 @@
+#ifndef LPMS_ME1_h
+#define LPMS_ME1_h
+
+#include "mbed.h"
+//#include <Arduino.h>
+//#include "RZ_A1H.h"
+
+class LpmsMe1{
+public:
+    LpmsMe1(Serial*);
+    void goto_command_mode();
+    void set_transmit_data();
+    void set_filter_mode();
+    void set_offset();
+    void reset_orientation_offset();
+    void get_sensor_data();
+    float get_z_angle();  
+    int recv_proc(int);
+    int init();
+
+private:
+    Serial* serial;
+    unsigned char buffer[25];
+    float anglex, angley, anglez;
+    float pre_rawanglex, pre_rawangley, pre_rawanglez;
+    bool init_ignore;
+    bool init_done; // 初期化が終わったかどうか
+};
+
+#endif
+