Descrição
(1137) Placa ESP32-C3 USB-C com ecrâ oled 0,42 polegadas Wifi Bluetooth Programa arduino IDE para escrever texto no ecra Oled No Arduino IDE deve-se escolher a placa ESP32C3 Dev Module Necessário instalar a biblioteca U8g2lib #include #include // there is no 72×40 constructor in u8g2 hence the 72×40 screen is mapped in the middle of the 132×64 pixel buffer of the SSD1306 controller U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE, 6, 5); int width = 72; int height = 40; int xOffset = 30; // = (132-w)/2 int yOffset = 12; // = (64-h)/2 void setup(void) { delay(1000); u8g2.begin(); u8g2.setContrast(255); // set contrast to maximum u8g2.setBusClock(400000); //400kHz I2C u8g2.setFont(u8g2_font_ncenB10_tr); } void loop(void) { u8g2.clearBuffer(); // clear the internal memory u8g2.setCursor(xOffset+15, yOffset+25); u8g2.printf(” Ola”); u8g2.setCursor(xOffset+0, yOffset+50); u8g2.printf(“lojapm.pt”); u8g2.sendBuffer(); // transfer internal memory to the display }





