#include <U8g2lib.h>
U8G2_MAX7219_8X8_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 18, /* data=*/ 19, /* cs=*/ 5, /* dc=*/ U8X8_PIN_NONE, /* reset=*/ U8X8_PIN_NONE);
const unsigned char smile[] = {
0x7e, 0x81, 0xa5, 0x81, 0x81, 0xbd, 0x81, 0x7e
};
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
u8g2.begin(); // begin function is required for u8g2 library
u8g2.setContrast(10*16); // set display contrast 0-255
}
void loop() {
// put your main code here, to run repeatedly:
u8g2.clearBuffer(); // clear the internal u8g2 memory
u8g2.drawXBM( 0, 0, 8, 8, smile);
u8g2.sendBuffer(); // transfer internal memory to the display
delay(10); // this speeds up the simulation
}