counter that keeps track of how many times button "A" has been pressed.
Use this activity document to guide your work in the speed button tutorial.
Answer the questions while completing the tutorial. Pay attention to the dialogues!
let count = 0
3. Draw which LED is ON after running this code and pressing Button A twice. Explain why you chose to draw that number
let count = 0
input.onButtonPressed(Button.A, () => {
count = count + 1
basic.showNumber(count, 100)
})
4. Draw which LED is ON after running this code and pressing Button A five times. Explain why you chose to draw that number.
let count = 0
input.onButtonPressed(Button.A, () => {
count = count + 1
basic.showNumber(count, 100)
})