Skip to content

Commit d72d720

Browse files
authored
Interfacing 16x2 LCD with Arduino
1 parent 2875d06 commit d72d720

12 files changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// include the library code:
2+
#include <LiquidCrystal.h>
3+
4+
// initialize the library by associating any needed LCD interface pin
5+
// with the arduino pin number it is connected to
6+
const int rs = 12, en = 11, d4 = 2, d5 = 3, d6 = 4, d7 = 5;
7+
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
8+
9+
void setup() {
10+
// set up the LCD's number of columns and rows:
11+
lcd.begin(16, 2);
12+
// Print a message to the LCD.
13+
lcd.print(" Circuit Digest!");
14+
delay(2000);
15+
for (int positionCounter = 0; positionCounter < 16; positionCounter++) {
16+
// scroll one position right:
17+
lcd.scrollDisplayRight();
18+
// wait a bit:
19+
delay(150);
20+
}
21+
lcd.clear();
22+
lcd.setCursor(6, 0);
23+
lcd.print("Count!");
24+
// print the number of seconds since reset:
25+
}
26+
27+
void loop() {
28+
for (int i = 0; i < 10; i ++)
29+
{
30+
lcd.setCursor(8, 1);
31+
// print the number of seconds since reset:
32+
lcd.print(i);
33+
delay(1000);
34+
}
35+
}
Binary file not shown.
Binary file not shown.
Loading
Loading
Loading
Loading
Loading
6.03 MB
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)