Skip to content

Commit be6c023

Browse files
authored
Add files via upload
1 parent 71e28c8 commit be6c023

File tree

3 files changed

+168
-0
lines changed

3 files changed

+168
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include <LiquidCrystal_I2C.h> // Library for LCD
2+
LiquidCrystal_I2C lcd = LiquidCrystal_I2C(0x27, 16, 2); // Change to (0x27,16,2) for 16x2 LCD.
3+
void setup() {
4+
lcd.init();
5+
lcd.backlight();
6+
lcd.print("Blinking text");
7+
}
8+
void loop() {
9+
lcd.display();
10+
delay(2000);
11+
lcd.noDisplay();
12+
delay(2000);
13+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include <LiquidCrystal_I2C.h> // Library for LCD
2+
// Wiring: SDA pin is connected to A4 and SCL pin to A5.
3+
// Connect to LCD via I2C, default address 0x27 (A0-A2 not jumpered)
4+
LiquidCrystal_I2C lcd = LiquidCrystal_I2C(0x27, 16, 2); // Change to (0x27,16,2) for 16x2 LCD.
5+
void setup() {
6+
lcd.init();
7+
lcd.backlight();
8+
}
9+
void loop() {
10+
lcd.autoscroll();
11+
lcd.setCursor(20, 0);
12+
for (int x = 0; x < 14; x++) {
13+
lcd.print(x);
14+
delay(500);
15+
}
16+
lcd.clear();
17+
}
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
/* display custom characters on I2C character LCD. More
2+
info: www.makerguides.com */
3+
// Include the library:
4+
#include <LiquidCrystal_I2C.h>
5+
// Create lcd object of class LiquidCrystal_I2C:
6+
LiquidCrystal_I2C lcd = LiquidCrystal_I2C(0x27, 16, 2);
7+
// Make custom characters:
8+
byte Heart[] = {
9+
B00000,
10+
B01010,
11+
B11111,
12+
B11111,
13+
B01110,
14+
B00100,
15+
B00000,
16+
B00000
17+
};
18+
byte Lock[] = {
19+
B01110,
20+
B10001,
21+
B10001,
22+
B11111,
23+
B11011,
24+
B11011,
25+
B11111,
26+
B00000
27+
};
28+
byte Speaker[] = {
29+
B00001,
30+
B00011,
31+
B01111,
32+
B01111,
33+
B01111,
34+
B00011,
35+
B00001,
36+
B00000
37+
};
38+
byte Sound[] = {
39+
B00001,
40+
B00011,
41+
B00101,
42+
B01001,
43+
B01001,
44+
B01011,
45+
B11011,
46+
B11000
47+
};
48+
byte Skull[] = {
49+
B00000,
50+
B01110,
51+
B10101,
52+
B11011,
53+
B01110,
54+
B01110,
55+
B00000,
56+
B00000
57+
};
58+
byte Bell[] = {
59+
B00100,
60+
B01110,
61+
B01110,
62+
B01110,
63+
B11111,
64+
B00000,
65+
B00100,
66+
B00000
67+
};
68+
byte Alien[] = {
69+
B11111,
70+
B10101,
71+
B11111,
72+
B11111,
73+
B01110,
74+
B01010,
75+
B11011,
76+
B00000
77+
};
78+
byte Check[] = {
79+
B00000,
80+
B00001,
81+
B00011,
82+
B10110,
83+
B11100,
84+
B01000,
85+
B00000,
86+
B00000
87+
};
88+
89+
byte plant[] = {
90+
B01110,
91+
B10001,
92+
B10001,
93+
B01110,
94+
B00100,
95+
B00100,
96+
B11111,
97+
B01110
98+
};
99+
100+
void setup() {
101+
// Initialize LCD and turn on the backlight:
102+
lcd.init();
103+
lcd.backlight();
104+
// Create new characters:
105+
lcd.createChar(0, Heart);
106+
lcd.createChar(1, Bell);
107+
lcd.createChar(2, Alien);
108+
lcd.createChar(3, Check);
109+
lcd.createChar(4, Speaker);
110+
lcd.createChar(5, Sound);
111+
lcd.createChar(6, Skull);
112+
lcd.createChar(7, Lock);
113+
lcd.createChar(8, plant);
114+
// Clear the LCD screen:
115+
lcd.clear();
116+
// Print a message to the lcd:
117+
lcd.print("Custom Character");
118+
}
119+
// Print all the custom characters:
120+
void loop() {
121+
lcd.setCursor(0, 1);
122+
lcd.write(0);
123+
lcd.setCursor(2, 1);
124+
lcd.write(1);
125+
lcd.setCursor(4, 1);
126+
lcd.write(2);
127+
lcd.setCursor(6, 1);
128+
lcd.write(3);
129+
lcd.setCursor(8, 1);
130+
lcd.write(4);
131+
lcd.setCursor(10, 1);
132+
lcd.write(5);
133+
lcd.setCursor(12, 1);
134+
lcd.write(6);
135+
lcd.setCursor(14, 1);
136+
lcd.write(8);
137+
lcd.setCursor(16, 1);
138+
}

0 commit comments

Comments
 (0)