Skip to content

Instantly share code, notes, and snippets.

@dsvakola
Created October 17, 2019 07:19
Show Gist options
  • Save dsvakola/95fd7d3c7cc6fa2f585058f637682919 to your computer and use it in GitHub Desktop.
Save dsvakola/95fd7d3c7cc6fa2f585058f637682919 to your computer and use it in GitHub Desktop.
Simplified code for 16x2 LCD display with Arduino UNO
/*
* The code is used with simplified connections of LCD display 16x2 with Arduino UNO
* Prof. Dattaraj Vidyasagar
*/
#include <LiquidCrystal.h>
const int rs=2,en=3,d4=4,d5=5,d6=6,d7=7;
LiquidCrystal lcd(rs,en,d4,d5,d6,d7);
int i;
void setup()
{
lcd.begin(16,2); // the LCD display is initiated
}
void loop()
{
lcd.clear(); // clears previous message on the display
lcd.setCursor(0,0); // first row selected
lcd.print("*VSAGAR ACADEMY*");
delay(3000);
lcd.setCursor(0,1); // second row
lcd.print(" www.vsagar.org ");
delay(3000);
// display decimal counter in second row
for(i=0;i<10;i++)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("*Decimal Digits*");
lcd.setCursor(0,1);
lcd.print("Decimal Count: ");
lcd.print(i);
delay(1000);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment