Pages: [1]   Go Down
Author Topic: Turning off an LCD from code  (Read 2898 times)
0 Members and 1 Guest are viewing this topic.
Malta
Offline Offline
Newbie
*
Karma: 0
Posts: 17
A Software Developer learning electronics
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

[size=14]This is a follow up to my previous question : Interfacing with a Winstar WH1602B LCD Screen


Is there any way turn off the LCD from code ?  

I tried using the lcd.noDisplay(); but that only hides the text displayed on the screen; ie the screen still remains on.[/size]
« Last Edit: September 14, 2009, 12:27:19 am by agnt666 » Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 417
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

try putting the lcd pin 15 to arduino digital pin 13.
ive been using digital pin to turn on the backlight:

int backLight = 13;    // pin 13 will control the backlight

void setup()
{
 lcd.begin(16,2);
  pinMode(backLight, OUTPUT);
  digitalWrite(backLight, HIGH); // turn backlight on. Replace 'HIGH' with 'LOW' to turn it off.
 
Logged

Spokane, Washington
Offline Offline
God Member
*****
Karma: 1
Posts: 686
My name is Bob, and I'm an addict.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You could have the power of the LCD controlled by another pin. But you'd need a transistor or something of the sort to do it without damaging your pins.

What most people do, is control the backlight with PWM. That way, you can just turn off the Backlight anytime you want. But that won't turn off the LCD it self, just the backlight.

Hope this gives you a general idea.
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 147
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There are two options, I've used both.

1. Use a transistor to switch the display's +5v on/off using a digital pin. Then you would need to initialize the display every time to switch it on.

2. Use one or two digital pins to control the backlight and contrast of the LCD. If you feed the positive side of the contrast pot with a digital pin, you can easily "switch off" the display with a single digitalWrite(). Remember to control the backlight in the same way.

I prefer (2). It's a lot less hassle as you only need to initalise the LCD once.
Logged

Spokane, Washington
Offline Offline
God Member
*****
Karma: 1
Posts: 686
My name is Bob, and I'm an addict.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

But keep in mind, if you're trying to save battery, turning off just the back light leaves the LCD driver itself powered. (They can take a decent amount of power)

But yeah. Back light is way easier.. by the way.. using PWM to control the back light may be better.. as you can control the brightness and obviously turn it off from the same pin.
Logged

Pages: [1]   Go Up
Jump to: