Things used in this project

Hardware components:
Microbitheart
BBC micro:bit board
×1
Software apps and online services:
Screen shot 2017 06 26 at 3 41 02 pm sfoohotutu
Microsoft MakeCode

Code

countdown timerJavaScript
let star2: Image = null
let star1: Image = null
let countingdown = false
let counter = 0
input.onButtonPressed(Button.A, () => {
    counter += 1
})
input.onButtonPressed(Button.B, () => {
    countingdown = true
})
star1 = images.createImage(`
    . . . . .
    . . . . .
    . . # . .
    . . . . .
    . . . . .
    `)
star2 = images.createImage(`
    . . . . .
    . . # . .
    . # # # .
    . . # . .
    . . . . .
    `)
counter = 3
countingdown = false
basic.forever(() => {
    basic.showNumber(counter)
    if (countingdown == true) {
        basic.pause(1000)
        counter += -1
        if (counter <= 0) {
            countingdown = false
            for (let i = 0; i < 4; i++) {
                star1.showImage(0)
                basic.pause(200)
                star2.showImage(0)
                basic.pause(200)
            }
            basic.showString("HAPPY NEW YEAR!")
        }
    }
})

Credits

201603141639347375
Ron Dagdag
36 projects • 242 followers
Microsoft MVP / Lead Software Engineer / Augmented Reality. Developer Passionate to learn about Robotics, VR, AR, ML, IOT
Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Add projectSign up / LoginAbout BBC micro:bit