Controlling LCD backlight

Posted on
  • Hi all,

    just received my first LCDs - same as in this tutorial: http://www.espruino.com/Onboard+LCD

    I tried to set A3 for the light to 1, but it does not light up. What's the trick?

    @Gordon first time I see the new IDE, it looks terrific!

  • Thanks! The signal for the backlight on those LCDs is inverted, so just try setting it to 0 :)

  • It is?

    It sure isn't on my PCD8544.

    This snippet of code is what I've been using to control the backlight (with the backlight pin on A2 - I don't have it soldered directly onto the board). When called, it turns the backlight on for 5 seconds (or resets the timer to 5 seconds if the backlight is already on). As you can see, this means that setting the pin high turns on the backlight...

    g.backlighton = function() {
    	digitalWrite(A2,1);
    	if (this.bktim) {
    		clearTimeout(this.bktim);
    		this.bktim=0;
    	}
    	this.bktim=setTimeout("digitalWrite(A2,0);g.bktim=0;",5000);
    };
    
  • Just tried here - the one I have on my desk definitely works when you connect the light pin to GND. Maybe there are 2 different types?

  • Hmm. That's probably it.

    There exist at least 4 different controller PCBs being sold with that display on ebay - The red one, and three blue ones: One that says "NOKIA 5110" and has a resistor and capacitor visible above the screen, one says "Nokia 5110 display module" above the screen, and one has a spot for a second set of pins there. I have the "NOKIA 5110" one.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Controlling LCD backlight

Posted by Avatar for hansamann @hansamann

Actions