Microbit Schedule (Cont.)

My code for the timer-planner is as follows-

let minutes = 0
input.onButtonPressed(Button.A, function () {
if (minutes < 60) {
minutes += 10
basic.showNumber(minutes)
basic.clearScreen()
}
})
input.onButtonPressed(Button.B, function () {
while (minutes > 0) {
basic.showNumber(minutes)
basic.pause(60000)
minutes += 0 – 1
}
})
input.onGesture(Gesture.Shake, function () {
if (minutes < 60) {
minutes += 1
basic.showNumber(minutes)
basic.clearScreen()
}
})
basic.forever(function () {
})
The only improvement that I think could help, is an alarm. This will be added shortly. However, the timer is fully functional, giving you the option to add 10 minutes or 1, going up to 2 hours.

One thought on “Microbit Schedule (Cont.)

  1. Thank-you for your posts. I noticed you are still missing your Information Fluency assignment. Please upload and email when it is complete.

Leave a Reply

Your email address will not be published. Required fields are marked *