• I am working on an app where it makes sense to immediately turn off the LCD screen backlight after the user has touched the screen. I have found ways to do this, but only with side effects, so I was hoping someone might be able to point me in the right direction. Here's what I've tried:

    1. Bangle.setLCDPower(false) : This turns off the backlight temporarily like I want... but also turns off the sunlight-readable display forever unless I turn it back on. Not really what I want. Just want to hit the backlight.
    2. Bangle.setLCDBrightness(0): This turns off the backlight! Yay! ... forever. Boooooo.

    I am hoping to just say "Hey turn off the backlight right now, and otherwise continue operating like normal".

    One possible solution I thought of, but seems a lot more hacky than it should be is:

    const prev = Bangle.getOptions().backlightTimeout; // record current setting
    Bangle.setOptions({backlightTimeout: 1}); // Timeout to 1ms
    setTimeout(() => Bangle.setOptions({backlightTimeout: prev}), 100); // resume previous setting
    

    Is that the best way to do this right now?

  • Annoyingly as you point out, right now I don't think there is a way to do this directly - however normally turning the light off is controlled by the backlight timeout, so I think your solution is probably the best one for the moment...

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

Is there a way to turn off the backlight without changing persistent settings?

Posted by Avatar for Philip @Philip

Actions