Bangle.setOptions({
lockTimeout: 99999999999, //1157 days
backlightTimeout: 10000 }); //10 seconds
function buttonPressed() {
// console.log("trigger");
}
The behaviour isn't quite what I expected because when the backlight turns off it takes two button presses to get buttonPressed() to trigger. I'm assuming the Bangle is listening for a button press to turn the screen back on then and then normal behaviour resumes.
This is how I'm handling the button press:
setWatch(buttonPressed, (process.env.HWVERSION==2) ? BTN1 : BTN2, { repeat: true, edge: 'rising', debounce: 50 });
I really need it to trigger buttonPressed on the first button press... is there an option that I'm missing, or perhaps an alternative way to handle the button press?
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.
Hi,
Just a quick question about backlightTimeout...
The behaviour isn't quite what I expected because when the backlight turns off it takes two button presses to get buttonPressed() to trigger. I'm assuming the Bangle is listening for a button press to turn the screen back on then and then normal behaviour resumes.
This is how I'm handling the button press:
setWatch(buttonPressed, (process.env.HWVERSION==2) ? BTN1 : BTN2, { repeat: true, edge: 'rising', debounce: 50 });
I really need it to trigger buttonPressed on the first button press... is there an option that I'm missing, or perhaps an alternative way to handle the button press?
Thanks.