Hardwarenahe Programmierung

SPI LCD

Für das LCD gibt es die C12832 Bibliothek und für ESP32 Arduino die U8G2 Bibliothek. Diese kann entweder über Tool->Manage Libraries (Strg+Shift+I) und suche nach U8G2 oder durch clonen und entpacken der U8G2 Bibliothek in Arduino-root\libraries installiert werden .

mbedEsp32S_LCD_SPI_HelloWorld.ino

#include <U8g2lib.h>
U8G2_ST7565_NHD_C12832_F_4W_HW_SPI u8g2(U8G2_R2, 5, 14, 13); // rotation = 180° = U8G2_R2 // VSPImosi(GPIO23), VSPIclk(GPIO18)

char buff[20];

void setup(void) {
  u8g2.begin();
}

void loop(void) {
  sprintf(buff, "Hello World");
  u8g2.setFont(u8g2_font_ncenB08_tr);
  u8g2.drawStr(0,30,buff);
  u8g2.sendBuffer();
}


All wikipages