#include <U8g2lib.h>
#define button 7
U8G2_MAX7219_32X8_F_4W_SW_SPI u8g2(U8G2_R2, /* clock=*/8, /* data=*/10, /* cs=*/9, /* dc=*/U8X8_PIN_NONE, /* reset=*/U8X8_PIN_NONE);
const unsigned char epd_bitmap_matrix_display_counter[] = {
0x7e, 0x67, 0x75, 0x77, 0xef, 0x21, 0x15, 0x44, 0xe7, 0x21, 0x15, 0x44, 0xe3, 0x27, 0x77, 0x77,
0xe7, 0x24, 0x11, 0x15, 0xef, 0x24, 0x11, 0x15, 0x7e, 0x77, 0x71, 0x77, 0x00, 0x00, 0x00, 0x00};
const unsigned char youtube_logo_bitmap[] = { // youtube bitmap logo, 8x7 px
B01111110,
B11101111,
B11100111,
B11100011,
B11100111,
B11101111,
B01111110};
byte digits[6] = {0, 0, 9, 9, 9, 8}; // individual digits to be displayed on the matrix display
byte digits_offset_perc[6] = {0, 0, 0, 0, 0, 0}; // y offset for the individual digits - percentage 0-100%
char digit_char[2]; // helper array for storing C-style string
char digit_char_next[2]; // helper array for storing C-style string
float y_offset; // y pixel offset for digit
void setup(void)
{
u8g2.begin(); // begin function is required for u8g2 library
u8g2.setContrast(10 * 16); // set display contrast 0-255
u8g2.setFont(u8g2_font_3x5im_tr); // choose a suitable font with digits 3px wide
// u8g2.setFlipMode(1);
}
void loop(void)
{
delay(10); // wokwi
u8g2.drawStr(0, 7, "1234"); // draw the current character to the display
u8g2.sendBuffer(); // transfer internal memory to the display
}