#include <Arduino.h>
#include <SPI.h>
#include <U8g2lib.h>
// U8G2 setup: SH1106 128x64 I2C Frame Buffer
U8G2_SSD1306_128X64_NONAME_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
uint8_t *buf;
/* u8g2.begin() is required and will sent the setup/init sequence to the display */
void setup(void) {
buf = (uint8_t *)malloc(u8g2.getBufferSize());
u8g2.setBufferPtr(buf);
u8g2.initDisplay();
u8g2.clearDisplay();
u8g2.setPowerSave(0);
// u8g2.begin();
}
/* draw something on the display with the `firstPage()`/`nextPage()` loop*/
void loop(void) {
u8g2.firstPage();
do {
u8g2.setFont(u8g2_font_ncenB14_tr);
u8g2.drawStr(0,20,"Hello World!");
} while ( u8g2.nextPage() );
delay(1000);
}