lcdPower event not working?

Posted on
  • After trying to isolate a severe problem in my code for more than an hour now, I ended up with the following code that does not seem to work on my real device(!)

        Bangle.on('lcdPower', (on) => {
    print('> on',on);
    print('> Bangle.isLCDOn',Bangle.isLCDOn());
        });
    

    After entering these lines into the right-hand side of the Web IDE, uploading to my Bangle.js,
    and switching between LCD on and off (by waiting and moving the clock) I do not get any response back!

    I'm running firmware 2v11

    Does anybody have any idea why?

  • Works for me! Did you use Bangle.setLCDPower(0)?

    Or what do you mean by LCD power? because the LCD is usually permanently on.

    Perhaps the 'lock' event is more what you're after?

  • Well, and what is "lcdPower" then good for?

    I thought, it would describe the backlight intensity - and would normally be off and just switched on from time to time when the watch is turned over.

    From the docs of Bangle.setLCDTimeout

    With power saving on, the display will turn on if a button is pressed, the watch is turned face up, or the screen is updated (see Bangle.setOptions for configuration). It'll turn off automatically after the given timeout.

    I want to get an event when backlight is switched on (in order to show more detailed information) or off, "lock" describes the touchscreen

  • I am a little confused: the "lcdPower" event never seems to get fired, but the "lock" event seems to get fired at the same time the screen goes on or off.

    So, what's the difference between those two?

  • On Bangle.js 1 the LCD turns on and off, so you get this event more. As I said above you can trigger LCD power by actually turning the LCD off manually, but this never usually happens.

    It's intentional, because the lcdPower event is basically saying 'can you see anything on the screen?`. If Bangle.js 2 used this for Backlight, Bangle.js 1 clock faces would just stop updating (that's how it used to be, which is why we have this arrangement now).

    I'm not sure there is a backlight event, but 99% of the time, the backlight and screen lock are basically the same thing since they are both triggered from the same 'wake' event and have the time timeout?

  • Thanks for explanation.

    That sounds as if the way it's currently implemented is mainly for compatibility reasons.

    Right now, I'm indeed using the "lock" event for my purposes

  • That sounds as if the way it's currently implemented is mainly for compatibility reasons.

    Yes, pretty much. But the LCD power event is for LCD power - it's doing exactly what it says. I guess the fact there isn't an explicit LCD backlight event as well is another issue.

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

lcdPower event not working?

Posted by Avatar for Andreas_Rozek @Andreas_Rozek

Actions