aaa

Dependencies:   mbed BNO055_fusion Adafruit_GFX ros_lib_kinetic

Revision:
4:cf1a4e503974
Child:
8:80708bacb5b5
diff -r a45557a0dcb8 -r cf1a4e503974 myOled.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/myOled.h	Wed Dec 12 03:35:52 2018 +0000
@@ -0,0 +1,36 @@
+#ifndef _MY_OLED_H_
+#define _MY_OLED_H_
+
+#include "mbed.h"
+#include "Adafruit_SSD1306.h"
+#include "odom.h"
+#include "type.h"
+
+class My_Oled : public Odom_Abstract, Adafruit_SSD1306_I2c
+{
+    private:
+        
+    public:
+        My_Oled(Odom *odom, I2C &i2c) : Odom_Abstract(odom), Adafruit_SSD1306_I2c(i2c, D10){
+            clearDisplay();
+        }
+        
+    private:
+        //Overlap function
+        virtual void loop(){
+            static uint32_t counter = 0;
+            if((++counter % 10) == 0){
+                setTextCursor(0,0);
+                printf("Court color -> %s\n\n", (get_court_color() ? "BLUE" : "RED")); 
+                printf("odom  x -> %8.4f\n", get_pose().x());
+                printf("      y -> %8.4f\n", get_pose().y());
+                printf("      a -> %8.4f\n", get_pose().z());
+                printf("drift x -> %8.4f\n", get_drift().x());
+                printf("      y -> %8.4f\n", get_drift().y());
+                printf("      a -> %8.4f\n", get_drift().z());
+                display();  
+            }
+        }
+
+};
+#endif
\ No newline at end of file