mirror of https://github.com/espruino/BangleApps
hardalarm 1 btn
parent
1726233805
commit
660653858a
|
@ -71,26 +71,30 @@ function showAlarm(alarm) {
|
|||
var currentGuess = 10;
|
||||
var randomNum = getRandomFromRange(0, 7, 13, 20);
|
||||
showNumberPicker(currentGuess, randomNum)
|
||||
setWatch(o => {
|
||||
if(!okClicked && currentGuess < 20) {
|
||||
currentGuess = currentGuess + 1;
|
||||
showNumberPicker(currentGuess, randomNum);
|
||||
|
||||
let onSwipe = (x, y) => {
|
||||
if (y == 1) {
|
||||
if(!okClicked && currentGuess < 20) {
|
||||
currentGuess = currentGuess + 1;
|
||||
showNumberPicker(currentGuess, randomNum);
|
||||
}
|
||||
}
|
||||
}, BTN1, {repeat: true, edge: 'rising'});
|
||||
else if (y == -1) {
|
||||
if(!okClicked && currentGuess > 0) {
|
||||
currentGuess = currentGuess - 1;
|
||||
showNumberPicker(currentGuess, randomNum);
|
||||
}
|
||||
}
|
||||
};
|
||||
Bangle.on("swipe", onSwipe);
|
||||
|
||||
|
||||
setWatch(o => {
|
||||
if(currentGuess == randomNum) {
|
||||
okClicked = true;
|
||||
showPrompt(msg, buzzCount, alarm);
|
||||
}
|
||||
}, BTN2, {repeat: true, edge: 'rising'});
|
||||
|
||||
setWatch(o => {
|
||||
if(!okClicked && currentGuess > 0) {
|
||||
currentGuess = currentGuess - 1;
|
||||
showNumberPicker(currentGuess, randomNum);
|
||||
}
|
||||
}, BTN3, {repeat: true, edge: 'rising'});
|
||||
}, BTN, {repeat: true, edge: 'rising'});
|
||||
|
||||
function buzz() {
|
||||
Bangle.buzz(500).then(()=>{
|
||||
|
|
Loading…
Reference in New Issue