ejemplo datos y LCD — ESP32 simulation

An interactive ESP32 circuit simulation you can run free in your browser on Velxio, by jesantosm.

Components

Sketch code

// ESP32-S3 Serial Echo
// Echoes anything received on Serial (UART0) back to the sender.
// Open the Serial Monitor, type something, and see it echoed back.

#include <LiquidCrystal_I2C.h> //libreria para la LCD

LiquidCrystal_I2C LCD = LiquidCrystal_I2C(0x27, 16, 2);

float a;

void setup() {
  Serial.begin(115200);
  LCD.init();
  LCD.backlight();
  LCD.setCursor(0, 0);
  LCD.print("Hola ");
  delay(1000);
  LCD.setCursor(0, 1);
  LCD.print("INGENIEROS ");
  delay(1000);
  LCD.clear();
  LCD.setCursor(0, 0);
  LCD.print("Serial Echo");
  LCD.setCursor(0, 1);
  LCD.print("Listo!");
   Serial.println("ESP32-dev kit v1 Serial Echo Listo!");
  Serial.println("Escribe algo en la terminal serial y da enter");
  
}

void loop() {
  if (Serial.available()) {
    String input = Serial.readStringUntil('\n');
    input.trim();
    if (input.length() > 0) {
      LCD.clear();
      Serial.print("Echo: ");
      Serial.println(input);
      LCD.setCursor(0, 0);
      LCD.print("Echo:");
      LCD.setCursor(0, 1);
      LCD.print(input.toFloat()*2);
    }
  }
}

More projects by jesantosm