Skip to content

Commit a3b43d6

Browse files
committed
Add new example to demonstrate & test the cursor in blinking and non-blinking operation.
1 parent 2181dc1 commit a3b43d6

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#include <Wire.h>
2+
#include <LiquidCrystal_I2C.h>
3+
4+
// Set the LCD address to 0x27 for a 16 chars and 2 line display
5+
LiquidCrystal_I2C lcd(0x27, 16, 2);
6+
7+
void setup()
8+
{
9+
// initialize the LCD
10+
lcd.begin();
11+
lcd.backlight();
12+
}
13+
14+
void loop()
15+
{
16+
bool blinking = true;
17+
lcd.cursor();
18+
19+
while (1) {
20+
if (blinking) {
21+
lcd.clear();
22+
lcd.print("No cursor blink");
23+
lcd.noBlink();
24+
blinking = false;
25+
} else {
26+
lcd.clear();
27+
lcd.print("Cursor blink");
28+
lcd.blink();
29+
blinking = true;
30+
}
31+
delay(4000);
32+
}
33+
}

0 commit comments

Comments
 (0)