@ -2,11 +2,11 @@
|
||||
|
||||
Display a number with a variable.
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Welcome! This tutorial will teach you how to make a counter that increments when button A is pressed. Let's get started!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
Let's start by creating a **local variable** `count` to keep track of the current count.
|
||||
|
||||
@ -35,9 +35,9 @@ input.onButtonPressed(Button.A, () => {
|
||||
```
|
||||
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/counter/challenges)
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -14,7 +14,7 @@ input.onButtonPressed(Button.A, () => {
|
||||
})
|
||||
```
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
Let's add the code to `count` when `B` is pressed. Add an event handler with `on button pressed(B)` then add the code to `count`.
|
||||
|
||||
@ -31,7 +31,7 @@ input.onButtonPressed(Button.B, () => {
|
||||
})
|
||||
```
|
||||
|
||||
### Challenge 3
|
||||
## Challenge 3
|
||||
|
||||
Now let's try to reset the counter when the @boardname@ is shaken. You will need to register an event handler with `on shake`.
|
||||
|
||||
|
Reference in New Issue
Block a user