Insert new hw video links (#1910)

This commit is contained in:
Galen Nickel
2019-03-11 15:04:38 -07:00
committed by Peli de Halleux
parent a4f6a553d9
commit c4868e131d
15 changed files with 111 additions and 5 deletions

View File

@ -29,6 +29,12 @@ instead of the USB cable.
* ``name`` means the pin that is being pressed, either `P0`, `P1`, or `P2`
## Pin presses in action
See how the @boardname@ detects a press at a pin or on something connected to a pin in this video:
https://www.youtube.com/watch?v=GEpZrvbsO7o
## Example: pin pressed counter
This program counts how many times you press the `P0` pin.
@ -36,10 +42,10 @@ Every time you press the pin, the program shows the number of times on the scree
```blocks
let count = 0
basic.showNumber(count, 100)
basic.showNumber(count)
input.onPinPressed(TouchPin.P0, () => {
count = count + 1
basic.showNumber(count, 100)
basic.showNumber(count)
})
```

View File

@ -25,6 +25,12 @@ instead of the USB cable.
* a [boolean](/blocks/logic/boolean) that means whether the pin you say is pressed (`true` or `false`)
## Pin presses in action
See how the @boardname@ detects a press at a pin or on something connected to a pin in this video:
https://www.youtube.com/watch?v=GEpZrvbsO7o
## Example
This program shows `1` if `P0` is pressed, and `0` if `P0` is not pressed: