Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
en:iot-open:practical:hardware:rtu:esp32:scenarios:lcd [2025/07/30 15:44] kivilands6en:iot-open:practical:hardware:rtu:esp32:scenarios:lcd [2025/07/30 15:46] (current) – [Prequisits] kivilands6
Line 1: Line 1:
 +====== ESP32 LCD 16x2 =====
 +This is an example of the lcd running, check the reference for more things to do: https://github.com/adafruit/Adafruit_LiquidCrystal
  
 +===== Prequisits ====
 +Platform.ini
 +<code>
 +lib_deps = adafruit/Adafruit LiquidCrystal@^2.0.2
 +</code>
 +===== Example ====
 +<code>
 +#include <Arduino.h>
 +#include <Adafruit_LiquidCrystal.h>
 +
 +#define LCD_RS 48
 +#define LCD_ENABLE 47
 +#define LCD_D4 34
 +#define LCD_D5 33
 +#define LCD_D6 26
 +#define LCD_D7 21
 +
 +static Adafruit_LiquidCrystal lcd(LCD_RS, LCD_ENABLE, LCD_D4, LCD_D5, LCD_D6, LCD_D7);
 +
 +void setup() {
 +  if (!lcd.begin(16, 2)) {
 +    Serial.println("Could not init LCD");
 +    while(1);
 +  }
 +  Serial.println("LCD ready.");
 +
 +  // Print a message to the LCD.
 +  lcd.print("IOT-OPEN");
 +}
 +void loop() {
 +  lcd.setCursor(0, 1);
 +  // print the number of seconds since reset:
 +  lcd.print(millis()/1000);
 +  delay(1000);
 +}
 +</code>
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0