//Including the needed libraries #include #include //Some necessary definitions of how big our glyphs and font library are #define OLEDCharSize 8 //number of bytes in a glyph #define OLEDUserFontSize (2*OLEDCharSize) //number of bytes in UserFont table OledClass OLED; //a class declaration uint8_t UserFont[OLEDUserFontSize] = { 0x81, 0x42, 0x24, 0x18, 0x18, 0x24, 0x42, 0x81, //the 'X' character 0xFF, 0xA5, 0xFF, 0xA5, 0xA5, 0xFF, 0xA5, 0xFF //the checkerboard }; void setup(){ OLED.begin(); OLED.defineUserChar(0, &UserFont[0*OLEDCharSize]); //define the 1st character OLED.defineUserChar(1, &UserFont[1*OLEDCharSize]); //define the 2nd character } void loop(){ OLED.clearBuffer(); //clear the display buffer OLED.setCursor(0,0); //placing the cursor in the upper left corner OLED.putString("The two defined"); OLED.setCursor(0,1); //placing the cursor one row down OLED.putString("characters are:"); OLED.setCursor(4,3); //moving the cursor again OLED.putChar(0); //place the first character OLED.setCursor(6,3); OLED.putString("and"); //flavor text OLED.setCursor(10,3); OLED.putChar(1); //place the 2nd character OLED.updateDisplay(); //update the display delay(5000); //a delay so you can see the screen }