// Scroll part of the screen display.setCursor(0,0); display.setTextSize(1); display.println("Scroll"); display.println("some part"); display.println("of the screen."); display.display(); display.startscrollright(0x00, 0x00); }
// 这里更改为开发板对应的引脚,当前示例以 esp32-c3 为例 U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0, /* clock=*/9, /* data=*/8, /* reset=*/ U8X8_PIN_NONE); // esp8266 U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); voidsetup(void){ u8g2.begin(); // u8x8.setFlipMode(1); // set number from 1 to 3, the screen word will rotary 180 } voidloop(void){ u8g2.clearBuffer(); // clear the internal memory u8g2.setFont(u8g2_font_ncenB08_tr); // choose a suitable font u8g2.drawStr(0,15,"Hello World!"); // write something to the internal memory u8g2.sendBuffer(); // transfer internal memory to the display // delay(1000); }