LCD Arduino Shield
Intro: LCD Arduino Shield
Today, I will be showing you how to use a LCD shield to display text using an Arduino. It is very easy.
Things you will need
1 Arduino UNO
1 LCD shield
Things you will need
1 Arduino UNO
1 LCD shield
STEP 1: Assemble
Well, this is easy.
STEP 2: Add Code
Just paste this in the Arduino IDE
#include
// LiquidCrystal Print
// by Peyt52
LiquidCrystal lcd(8, 13, 9, 4, 5, 6, 7);
void setup()
{
lcd.clear();
lcd.begin(16, 2);
}
void loop()
{
lcd.setCursor(0, 0);
lcd.print(""); //First line of text
lcd.setCursor(0, 1);
lcd.print(""); //Second line of text
}
I hope that was easy enough. Ask questions in the comments!
#include
// LiquidCrystal Print
// by Peyt52
LiquidCrystal lcd(8, 13, 9, 4, 5, 6, 7);
void setup()
{
lcd.clear();
lcd.begin(16, 2);
}
void loop()
{
lcd.setCursor(0, 0);
lcd.print(""); //First line of text
lcd.setCursor(0, 1);
lcd.print(""); //Second line of text
}
I hope that was easy enough. Ask questions in the comments!
9 Comments
Conor M 8 years ago
Please update and correct your code
Conor M 8 years ago
The correct code is:
// LiquidCrystal Print
// by Conor M
#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 13, 9, 4, 5, 6, 7);
void setup()
{
lcd.clear();
lcd.begin(16, 2);
}
void loop()
{
lcd.setCursor(0, 0);
lcd.print("INSERT TEXT HERE"); //First line of text
lcd.setCursor(0, 1);
lcd.print("INSERT TEXT HERE"); //Second line of text
}
ArthurB2 8 years ago
Hi,
when I upload the code, the following errors appear:
lcd1.ino:1:10: error: #include expects "FILENAME" or <FILENAME>
lcd1.ino:7:1: error: 'LiquidCrystal' does not name a type
lcd1.ino: In function 'void setup()':
lcd1.ino:13:1: error: 'lcd' was not declared in this scope
lcd1.ino: In function 'void loop()':
lcd1.ino:23:1: error: 'lcd' was not declared in this scope
could you please help me?
hS5 9 years ago
Your code is wrong. It doesn't work
Help please
thanks
tbear5 9 years ago
hi , like a add a switch status on - off
I do not know how to write the status of my interuteur , OPEN or close. the screen. pouver you helped me ? thank you for avence . thx
peyt52 9 years ago
Bligoan 9 years ago
peyt52 9 years ago
Bligoan 9 years ago