I am doing a timer with two simple function -
(1) When press button A, plus 1
(2) When press button B, minus 1 until 0
I’ve worked out the following code but not work for (2). Could someone help me, please?
input.onButtonPressed(Button.A, function () {
while (true) {
Time = Time + 1
basic.showNumber(Time)
basic.pause(10)
basic.clearScreen()
}
})
input.onButtonPressed(Button.B, function () {
while (Time > 0) {
Time = Time - 1
basic.showNumber(Time)
basic.pause(10)
basic.clearScreen()
}
})