#include <Wire.h>
#include <U8g2lib.h>
#define bigFont u8g2_font_10x20_tf
#define smallFont u8g2_font_6x13_t_cyrillic
U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE); // All Boards without Reset of the Display
char s[25];
int row = 3;
void setup(void) {
u8g2.begin();
u8g2.setFontPosTop();
u8g2.setDrawColor(1);
}
void loop(void) {
u8g2.clearBuffer();
u8g2.drawFrame(0, 0, 128, 64);
strcpy(s, "AM 12:48:43");
u8g2.setFont(bigFont);
u8g2.drawStr((128 - u8g2.getStrWidth(s)) / 2, row, s);
row = row + u8g2.getMaxCharHeight() - 2;
strcpy(s, "Mon, 19 Mar 2024");
u8g2.setFont(smallFont);
if (u8g2.getStrWidth(s) > 127) strcpy(s, "---");
u8g2.drawStr((128 - u8g2.getStrWidth(s)) / 2, row, s);
row = row + u8g2.getMaxCharHeight() + 1;
strcpy(s, "23.1C 48.5% 1012.2mb");
u8g2.setFont(smallFont);
if (u8g2.getStrWidth(s) > 127) strcpy(s, "---");
u8g2.drawStr((128 - u8g2.getStrWidth(s)) / 2, row, s);
row = row + u8g2.getMaxCharHeight() + 1;
strcpy(s, "12:45P Maghrb 8h 23m");
u8g2.setFont(smallFont);
if (u8g2.getStrWidth(s) > 127) strcpy(s, "---");
u8g2.drawStr((128 - u8g2.getStrWidth(s)) / 2, row, s);
u8g2.sendBuffer();
//delay(2000);
while (1);
//delay(50);
}