Skip to content

Instantly share code, notes, and snippets.

@mjdargen
Last active July 16, 2020 15:32
Show Gist options
  • Save mjdargen/9563617dc9724471bc3b61fd44b3b808 to your computer and use it in GitHub Desktop.
Save mjdargen/9563617dc9724471bc3b61fd44b3b808 to your computer and use it in GitHub Desktop.
/*
Liquid Crystal
The LCD circuit:
* LCD RS pin to digital pin 7
* LCD Enable pin to digital pin 8
* LCD D4 pin to digital pin 9
* LCD D5 pin to digital pin 10
* LCD D6 pin to digital pin 11
* LCD D7 pin to digital pin 12
* LCD R/W pin to ground
* 10K potentiometer:
* ends to +5V and ground
* wiper to LCD VO pin (pin 3)
*/
// include the library code:
#include <LiquidCrystal.h>
// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
const int rs = 7, en = 8, d4 = 9, d5 = 10, d6 = 11, d7 = 12;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
// put your setup code here, to run once:
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Welcome the user
lcd.print("Welcome!");
// delay 2 seconds
delay(2000);
// clear and reset
lcd.clear();
lcd.setCursor(0,0);
//print hello world
lcd.print("Hello World!");
}
// put your main code here, to run repeatedly:
void loop() {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment