Use BTN2 for settings menu like other clocks

pull/301/head^2
Gordon Williams 2020-04-14 15:56:12 +01:00
parent 86c2d02e73
commit 22a005203f
3 changed files with 11 additions and 10 deletions

View File

@ -1191,7 +1191,7 @@
"name": "Numerals Clock",
"shortName": "Numerals Clock",
"icon": "numerals.png",
"version":"0.01",
"version":"0.02",
"description": "A simple big numerals clock",
"tags": "numerals,clock",
"type":"clock",
@ -1209,7 +1209,7 @@
"version":"0.02",
"description": "Detect BLE devices and show some informations.",
"tags": "app,bluetooth,tool",
"readme": "README.md",
"readme": "README.md",
"storage": [
{"name":"bledetect.app.js","url":"bledetect.js"},
{"name":"bledetect.img","url":"bledetect-icon.js","evaluate":true}
@ -1222,7 +1222,7 @@
"version":"0.01",
"description": "The classic snake game. Eat apples and don't bite your tail:",
"tags": "game,fun",
"readme": "README.md",
"readme": "README.md",
"storage": [
{"name":"snake.app.js","url":"snake.js"},
{"name":"snake.img","url":"snake-icon.js","evaluate":true}

View File

@ -1 +1,2 @@
0.01: New App!
0.02: Use BTN2 for settings menu like other clocks

View File

@ -11,7 +11,7 @@ var numerals = {
1:[[59,1,82,1,90,9,90,82,82,90,73,90,65,82,65,27,59,27,51,19,51,9,59,1]],
2:[[9,1,82,1,90,9,90,47,82,55,21,55,21,64,82,64,90,72,90,82,82,90,9,90,1,82,1,43,9,35,70,35,70,25,9,25,1,17,1,9,9,1]],
3:[[9,1,82,1,90,9,90,82,82,90,9,90,1,82,1,74,9,66,70,66,70,57,9,57,1,49,1,41,9,33,70,33,70,25,9,25,1,17,1,9,9,1]],
4:[[9,1,14,1,22,9,22,34,69,34,69,9,77,1,82,1,90,9,90,82,82,90,78,90,70,82,70,55,9,55,1,47,1,9,9,1]],
4:[[9,1,14,1,22,9,22,34,69,34,69,9,77,1,82,1,90,9,90,82,82,90,78,90,70,82,70,55,9,55,1,47,1,9,9,1]],
5:[[9,1,82,1,90,9,90,17,82,25,21,25,21,35,82,35,90,43,90,82,82,90,9,90,1,82,1,72,9,64,71,64,71,55,9,55,1,47,1,9,9,1]],
6:[[9,1,82,1,90,9,90,14,82,22,22,22,22,36,82,36,90,44,90,82,82,90,9,90,1,82,1,9,9,1],[22,55,69,55,69,69,22,69,22,55]],
7:[[9,1,82,1,90,9,90,15,15,90,9,90,1,82,1,76,54,23,9,23,1,15,1,9,9,1]],
@ -47,7 +47,7 @@ if (!settings) {
function drawNum(num,col,x,y,func){
g.setColor(col);
let tx = x*100+35;
let ty = y*100+35;
let ty = y*100+35;
for (let i=0;i<numerals[num].length;i++){
if (i>0) g.setColor((func==fill)?"#000000":col);
func(translate(tx, ty,numerals[num][i]));
@ -57,7 +57,7 @@ function drawNum(num,col,x,y,func){
function draw(drawMode){
let d = new Date();
let h1 = Math.floor(d.getHours()/10);
let h2 = d.getHours()%10;
let h2 = d.getHours()%10;
let m1 = Math.floor(d.getMinutes()/10);
let m2 = d.getMinutes()%10;
g.clearRect(0,24,240,240);
@ -70,9 +70,9 @@ function draw(drawMode){
Bangle.setLCDMode();
clearWatch();
setWatch(Bangle.showLauncher, BTN1, {repeat:false,edge:"falling"});
setWatch(Bangle.showLauncher, BTN2, {repeat:false,edge:"falling"});
g.clear();
g.clear();
clearInterval();
if (settings.color>0) _rCol=settings.color-1;
interval=setInterval(draw, REFRESH_RATE, settings.drawMode);
@ -80,7 +80,7 @@ draw(settings.drawMode);
Bangle.on('lcdPower', function(on) {
if (on) {
if (settings.color==0) _rCol = Math.floor(Math.random()*_hCol.length);
if (settings.color==0) _rCol = Math.floor(Math.random()*_hCol.length);
draw(settings.drawMode);
interval=setInterval(draw, REFRESH_RATE, settings.drawMode);
}else
@ -90,4 +90,4 @@ Bangle.on('lcdPower', function(on) {
});
Bangle.loadWidgets();
Bangle.drawWidgets();
Bangle.drawWidgets();