// *** meierinc copyright 2022 *** //
// *** [email protected] *** //
// *** includes *** //
#include <U8g2lib.h>
#include <Wire.h>
// *** const *** //
U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
// 这串代码不用记,打开源文件就有,可以直接拷贝。
// *** notes *** //
// data 21; clock 22
// *** tasks *** //
// *** origin *** //
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
u8g2.begin();
u8g2.enableUTF8Print();
}
void loop() {
// put your main code here, to run repeatedly:
u8g2.clearBuffer(); // clear the internal memory
// u8g2.setFont(u8g2_font_ncenB08_tr); // choose a suitable font
u8g2.setFont(u8g2_font_unifont_t_chinese2);
u8g2.setCursor(0,15); // set write position
u8g2.print("u8g2"); // write something to the internal memory
u8g2.setCursor(0,30);
u8g2.print("通用八位图形库第二代");
u8g2.sendBuffer(); // transfer internal memory to the display
}