therealnate70
Published © GPL3+

Serial Monitor to LCD

Make an LCD screen respond to you when you type something into the Serial Monitor

IntermediateFull instructions provided21,589
Serial Monitor to LCD

Things used in this project

Hardware components

Resistor 10k ohm
Resistor 10k ohm
×1
Standard LCD - 16x2 White on Blue
Adafruit Standard LCD - 16x2 White on Blue
×1
Rotary potentiometer (generic)
Rotary potentiometer (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Arduino UNO
Arduino UNO
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Pliers

Story

Read more

Schematics

How to connect the LCD screen

Build this circuit, then look at the code.

Code

Serial_to_LCD.ino

Arduino
You can change the text if you want. This is only an example.
#include <LiquidCrystal.h>

String a;

const int rs = 12, en = 10, d4 = 7, d5 = 6, d6 = 5, d7 = 4;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void setup() {
  lcd.begin(16, 2);
  Serial.begin(9600);
  lcd.write("Awaiting");
  lcd.setCursor(0,1);
  lcd.write("Commands");
  lcd.setCursor(0,0);
}

void loop() {
  lcd.clear();
  lcd.write("Awaiting");
  lcd.setCursor(0,1);
  lcd.write("Commands");
  lcd.setCursor(0,0);
  if(Serial.available())
  {
    a = Serial.readString();
    Serial.println(a);
    
    if(a.startsWith("Activate"))
    {
    delay(100);
    lcd.clear();
    lcd.write("Hello");
    delay(1000);
    lcd.clear();
    lcd.write("World");
    delay(1000);
    lcd.clear();
    lcd.write("");
    delay(1000);
    lcd.clear();
    lcd.write("10");
    delay(1000);
    lcd.clear();
    lcd.write("9");
    delay(1000);
    lcd.clear();
    lcd.write("8");
    delay(1000);
    lcd.clear();
    lcd.write("7");
    delay(1000);
    lcd.clear();
    lcd.write("6");
    delay(1000);
    lcd.clear();
    lcd.write("5");
    delay(1000);
    lcd.clear();
    lcd.write("4");
    delay(1000);
    lcd.clear();
    lcd.write("3");
    delay(1000);
    lcd.clear();
    lcd.write("2");
    delay(1000);
    lcd.clear();
    lcd.write("1");
    delay(1000);
    lcd.clear();
    lcd.write("0");
    delay(1000);
    lcd.clear();
    lcd.write("Success");
    delay(1000);
    lcd.clear();  
  }
  if (!a.startsWith("Activate")){
    lcd.clear();
    lcd.print("Incorrect");
    lcd.setCursor(0,1);
    lcd.print("Code");
    delay(2000);
    lcd.clear();
    lcd.setCursor(0,0);
  }
}
}

Credits

therealnate70

therealnate70

0 projects • 0 followers

Comments