hardalarm 1 btn

pull/3071/head
James Steinberg 2023-11-02 03:31:44 -04:00
parent 1726233805
commit 660653858a
1 changed files with 17 additions and 13 deletions

View File

@ -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(()=>{