#include <U8g2lib.h> // Include U8g2 library
// U8g2 Constructor for SSD1306 OLED display (128x64 pixels)
U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0, /* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE);
void setup() {
u8g2.begin(); // Initialize U8g2 library
}
void loop() {
u8g2.clearBuffer(); // Clear the display buffer
u8g2.setFont(u8g2_font_helvR14_tf); // Set font to use
u8g2.drawStr(0, 20, "Hello freelance"); // Draw text at position (0, 20)
u8g2.drawStr(0, 50, "from U8g2lib"); // Draw text at position (0, 20)
u8g2.sendBuffer(); // Send the display buffer to the OLED display
delay(1000); // Delay for 1 second
}