mirror of
https://github.com/buzz-lightsnack-2007/MicroBit_SimpleCounter.git
synced 2024-08-14 23:50:57 +00:00
Initial files for MakeCode project
This commit is contained in:
parent
ba252b0a14
commit
3d08876c33
11 changed files with 149 additions and 0 deletions
25
main.ts
Normal file
25
main.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
/**
|
||||
CounterTracker
|
||||
simple counter tracker for the Micro:Bit
|
||||
|
||||
*/
|
||||
|
||||
input.onButtonPressed(Button.A, function () {
|
||||
count += 1;
|
||||
basic.showNumber(count)
|
||||
})
|
||||
|
||||
input.onButtonPressed(Button.AB, function() {
|
||||
count = 0;
|
||||
basic.showNumber(count)
|
||||
})
|
||||
|
||||
function startup(): boolean {
|
||||
music.ringTone(Note.C)
|
||||
count = 0;
|
||||
basic.showNumber(count)
|
||||
return true
|
||||
}
|
||||
|
||||
let count = 0;
|
||||
startup()
|
Loading…
Add table
Add a link
Reference in a new issue