adding on pin pressed in getting-started
This commit is contained in:
parent
5a18bea9eb
commit
45fd40a553
@ -31,6 +31,7 @@ and press **A** to scroll your text.
|
|||||||
### Step 5
|
### Step 5
|
||||||
|
|
||||||
Place more blocks to display a smiley when button **B** is pressed.
|
Place more blocks to display a smiley when button **B** is pressed.
|
||||||
|
Use the dropdown to find ``B``!
|
||||||
|
|
||||||
```block
|
```block
|
||||||
input.onButtonPressed(Button.B, () => {
|
input.onButtonPressed(Button.B, () => {
|
||||||
@ -59,3 +60,15 @@ input.onGesture(Gesture.Shake, () => {
|
|||||||
`)
|
`)
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Step 7
|
||||||
|
|
||||||
|
Drag more blocks to display a random number when pin ``P0`` is touched.
|
||||||
|
Hold your right thumb on the ``GND`` metal pin
|
||||||
|
at press the ``0`` pin with your right hand to trigger this event.
|
||||||
|
|
||||||
|
```block
|
||||||
|
input.onPinPressed(TouchPin.P0, () => {
|
||||||
|
basic.showNumber(Math.random(7))
|
||||||
|
})
|
||||||
|
```
|
Loading…
x
Reference in New Issue
Block a user