aaa

Dependencies:   mbed BNO055_fusion Adafruit_GFX ros_lib_kinetic

myOled.h

Committer:
nakedt555
Date:
2018-12-12
Revision:
4:cf1a4e503974
Child:
8:80708bacb5b5

File content as of revision 4:cf1a4e503974:

#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