adding on pin pressed in getting-started

This commit is contained in:
Peli de Halleux 2017-01-17 11:37:20 -08:00
parent 5a18bea9eb
commit 45fd40a553

View File

@ -31,6 +31,7 @@ and press **A** to scroll your text.
### Step 5
Place more blocks to display a smiley when button **B** is pressed.
Use the dropdown to find ``B``!
```block
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))
})
```