Skip to content

Commit ba6192b

Browse files
committed
Add contrast and backlight settings. Should address issue 17.
1 parent ff901df commit ba6192b

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

examples/Example1-HelloWorld/Example1-HelloWorld.ino

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ void setup() {
4141

4242
lcd.begin(Wire); //Set up the LCD for I2C communication
4343

44+
lcd.setBacklight(255, 255, 255); //Set backlight to bright white
45+
lcd.setContrast(5); //Set contrast. Lower to 0 for higher contrast.
46+
4447
lcd.clear(); //Clear the display - this moves the cursor to home position as well
4548
lcd.print("Hello, World!");
4649
}

examples/Serial/Example1-HelloWorld/Example1-HelloWorld.ino

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ void setup() {
4040
Serial.begin(9600);
4141

4242
lcd.begin(Serial); //Set up the LCD for Serial communication at 9600bps
43+
44+
lcd.setBacklight(255, 255, 255); //Set backlight to bright white
45+
lcd.setContrast(5); //Set contrast. Lower to 0 for higher contrast.
46+
47+
lcd.clear(); //Clear the display - this moves the cursor to home position as well
4348
lcd.print("Hello, World!");
4449
}
4550

@@ -50,4 +55,3 @@ void loop() {
5055
// Print the number of seconds since reset:
5156
lcd.print(millis() / 1000);
5257
}
53-

0 commit comments

Comments
 (0)