Projet

Général

Profil

Izabela Grubicka » sketch_jul10a.ino

Izabela Grubicka, 17/07/2026 15:46

 
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);

byte un[] = {
B00000,
B00011,
B00100,
B01000,
B01000,
B00100,
B00010,
B00001
};

byte deux[] = {
B00000,
B00000,
B00000,
B00000,
B00000,
B00000,
B00000,
B00000
};

byte trois[] = {
B01100,
B10010,
B00001,
B00000,
B00000,
B00000,
B00000,
B00000
};

byte quatre[] = {
B00000,
B00000,
B00000,
B10000,
B10000,
B00000,
B00000,
B00000
};

byte cinq[] = {
B00000,
B00000,
B00000,
B00000,
B00000,
B00001,
B10010,
B01100
};

void setup() {
Wire.begin(21, 22); // SDA = 21, SCL = 22 (pins par défaut du LCD sur un ESP32)

lcd.init();
lcd.backlight();
lcd.createChar(1, un); // Création du caractère degrés
lcd.createChar(2, deux);
lcd.createChar(3, trois);
lcd.createChar(4, quatre);
lcd.createChar(5, cinq);
lcd.clear();

}

void loop() {
lcd.setCursor(3, 0);
lcd.write(1);
lcd.write(2);
lcd.write(3);
lcd.write(4);
lcd.setCursor(5, 1);
lcd.write(5);

}
(35-35/44)