aaa
Dependencies: mbed BNO055_fusion Adafruit_GFX ros_lib_kinetic
Diff: myOled.h
- Revision:
- 8:80708bacb5b5
- Parent:
- 4:cf1a4e503974
--- a/myOled.h Tue Dec 18 22:06:34 2018 +0000 +++ b/myOled.h Thu Dec 20 20:54:35 2018 +0000 @@ -9,17 +9,28 @@ class My_Oled : public Odom_Abstract, Adafruit_SSD1306_I2c { private: - + bool display_flag_; + public: My_Oled(Odom *odom, I2C &i2c) : Odom_Abstract(odom), Adafruit_SSD1306_I2c(i2c, D10){ clearDisplay(); + display_flag_ = true; } private: //Overlap function virtual void loop(){ static uint32_t counter = 0; - if((++counter % 10) == 0){ + if(display_flag_ == true && get_enable_oled() == false){ + setTextCursor(0,0); + clearDisplay(); + display(); + display_flag_ = false; + } + + if(get_enable_oled() && (++counter % 20) == 0){ + display_flag_ = true; + setTextCursor(0,0); printf("Court color -> %s\n\n", (get_court_color() ? "BLUE" : "RED")); printf("odom x -> %8.4f\n", get_pose().x());