commit
3b859838b0
|
|
@ -7,3 +7,4 @@
|
||||||
0.08: Add support for app/widget settings
|
0.08: Add support for app/widget settings
|
||||||
0.09: Move Welcome into App/widget settings
|
0.09: Move Welcome into App/widget settings
|
||||||
0.10: Added LCD wake-up settings
|
0.10: Added LCD wake-up settings
|
||||||
|
Adds LCD brightness setting
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
clock: null, // a string for the default clock's name
|
clock: null, // a string for the default clock's name
|
||||||
"12hour" : false, // 12 or 24 hour clock?
|
"12hour" : false, // 12 or 24 hour clock?
|
||||||
// welcomed : undefined/true (whether welcome app should show)
|
// welcomed : undefined/true (whether welcome app should show)
|
||||||
|
brightness: 1, // LCD brightness from 0 to 1
|
||||||
options: {
|
options: {
|
||||||
wakeOnBTN1: true,
|
wakeOnBTN1: true,
|
||||||
wakeOnBTN2: true,
|
wakeOnBTN2: true,
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,8 @@ function resetSettings() {
|
||||||
timezone: 0, // Set the timezone for the device
|
timezone: 0, // Set the timezone for the device
|
||||||
HID: false, // BLE HID mode, off by default
|
HID: false, // BLE HID mode, off by default
|
||||||
clock: null, // a string for the default clock's name
|
clock: null, // a string for the default clock's name
|
||||||
"12hour": false, // 12 or 24 hour clock?
|
"12hour" : false, // 12 or 24 hour clock?
|
||||||
|
brightness: 1, // LCD brightness from 0 to 1
|
||||||
// welcomed : undefined/true (whether welcome app should show)
|
// welcomed : undefined/true (whether welcome app should show)
|
||||||
options: {
|
options: {
|
||||||
wakeOnBTN1: true,
|
wakeOnBTN1: true,
|
||||||
|
|
@ -98,14 +99,25 @@ function showMainMenu() {
|
||||||
Bangle.setLCDTimeout(settings.timeout);
|
Bangle.setLCDTimeout(settings.timeout);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
'LCD Brightness': {
|
||||||
|
value: settings.brightness,
|
||||||
|
min: 0,
|
||||||
|
max: 1,
|
||||||
|
step: 0.1,
|
||||||
|
onchange: v => {
|
||||||
|
settings.brightness = v || 1;
|
||||||
|
updateSettings();
|
||||||
|
Bangle.setLCDBrightness(settings.brightness);
|
||||||
|
}
|
||||||
|
},
|
||||||
'Beep': {
|
'Beep': {
|
||||||
value: 0 | beepV.indexOf(settings.beep),
|
value: 0 | beepV.indexOf(settings.beep),
|
||||||
min: 0, max: 2,
|
min: 0, max: 2,
|
||||||
format: v => beepN[v],
|
format: v => beepN[v],
|
||||||
onchange: v => {
|
onchange: v => {
|
||||||
settings.beep = beepV[v];
|
settings.beep = beepV[v];
|
||||||
if (v == 1) { analogWrite(D18, 0.5, { freq: 2000 }); setTimeout(() => D18.reset(), 200) } // piezo
|
if (v==1) { analogWrite(D18,0.5,{freq:2000});setTimeout(()=>D18.reset(),200); } // piezo
|
||||||
else if (v == 2) { analogWrite(D13, 0.1, { freq: 2000 }); setTimeout(() => D13.reset(), 200) } // vibrate
|
else if (v==2) { analogWrite(D13,0.1,{freq:2000});setTimeout(()=>D13.reset(),200); } // vibrate
|
||||||
updateSettings();
|
updateSettings();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue