Created
May 15, 2017 13:32
-
-
Save bazwilliams/b444417d623d5330c304c29400ebc5a2 to your computer and use it in GitHub Desktop.
BBC Micro:bit Toothbrush timer project. Create a new project at https://pxt.microbit.org/, choose the javascript tab and paste this code in.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input.onButtonPressed(Button.A, () => { | |
music.beginMelody(music.builtInMelody(Melodies.PowerUp), MelodyOptions.Once) | |
basic.showNumber(3) | |
basic.pause(20) | |
basic.showNumber(2) | |
basic.pause(20) | |
basic.showNumber(1) | |
basic.pause(20) | |
basic.showString("Go!") | |
music.beginMelody(music.builtInMelody(Melodies.JumpUp), MelodyOptions.Once) | |
images.createImage(` | |
# # . . . | |
# # . . . | |
. . . . . | |
. . . . . | |
. . . . . | |
`).showImage(0) | |
basic.pause(20000) | |
music.beginMelody(music.builtInMelody(Melodies.JumpUp), MelodyOptions.Once) | |
images.createImage(` | |
. . . . . | |
. . . . . | |
. . . . . | |
# # . . . | |
# # . . . | |
`).showImage(0) | |
basic.pause(20000) | |
music.beginMelody(music.builtInMelody(Melodies.JumpUp), MelodyOptions.Once) | |
images.createImage(` | |
. . . # # | |
. . . # # | |
. . . . . | |
. . . . . | |
. . . . . | |
`).showImage(0) | |
basic.pause(20000) | |
music.beginMelody(music.builtInMelody(Melodies.JumpUp), MelodyOptions.Once) | |
images.createImage(` | |
. . . . . | |
. . . . . | |
. . . . . | |
. . . # # | |
. . . # # | |
`).showImage(0) | |
basic.pause(20000) | |
music.beginMelody(music.builtInMelody(Melodies.JumpUp), MelodyOptions.Once) | |
images.createImage(` | |
. . . . . | |
. . . . . | |
. . . . . | |
. # # # . | |
. # # # . | |
`).showImage(0) | |
basic.pause(20000) | |
music.beginMelody(music.builtInMelody(Melodies.JumpUp), MelodyOptions.Once) | |
images.createImage(` | |
. # # # . | |
. # # # . | |
. . . . . | |
. . . . . | |
. . . . . | |
`).showImage(0) | |
basic.pause(20000) | |
music.beginMelody(music.builtInMelody(Melodies.Entertainer), MelodyOptions.Once) | |
images.createImage(` | |
. # . # . | |
. . . . . | |
# . . . # | |
# # # # # | |
. # # # . | |
`).showImage(0) | |
basic.pause(4000) | |
basic.clearScreen() | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment