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:
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.
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
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
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:
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.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:
Is that the best way to do this right now?