#include <U8g2lib.h>
#include <Wire.h>
void oledTask(void* pvParam)
{
U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
u8g2.begin();
for (;;) {
u8g2.clearBuffer(); // clear the internal memory
u8g2.setFont(u8g2_font_ncenB08_tr); // choose a suitable font
u8g2.drawStr(15, 10, "LONELY BINARY"); // write something to the internal memory
u8g2.sendBuffer(); // transfer internal memory to the display
vTaskDelay(1000);
}
}
void setup()
{
// put your setup code here, to run once:
Serial.begin(115200);
xTaskCreatePinnedToCore(oledTask, "OLED Task", 1024 * 6, NULL, 1, NULL, 1);
vTaskDelete(NULL);
}
void loop()
{
// put your main code here, to run repeatedly:
}