Skip to content

Instantly share code, notes, and snippets.

@techzeero
Last active October 21, 2019 09:57
Show Gist options
  • Save techzeero/0be3a4c025caac7ed4d0482321c29bfa to your computer and use it in GitHub Desktop.
Save techzeero/0be3a4c025caac7ed4d0482321c29bfa to your computer and use it in GitHub Desktop.
we learn how to use an LCD Display with Arduino. We use LCD 16 x 2 Display. https://techzeero.com/arduino-tutorials/how-to-use-an-lcd-display-with-arduino/
/*
How to use an LCD Display with Arduino
For more details, visit: https://techzeero.com/arduino-tutorials/how-to-use-an-lcd-display-with-arduino/
The circuit:
* LCD RS pin to digital pin 12
* LCD Enable pin to digital pin 11
* LCD D4 pin to digital pin 5
* LCD D5 pin to digital pin 4
* LCD D6 pin to digital pin 3
* LCD D7 pin to digital pin 2
* LCD R/W pin to ground
* LCD VSS pin to ground
* LCD VCC pin to 5V
* 10K resistor:
* ends to +5V and ground
* wiper to LCD VO pin (pin 3)
*/
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("Infinity");
}
void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis() / 1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment