Add some linking for hw vids (#1813)
* add linking for hw vids, fix card pages * revert vid card page and inline youtube links
This commit is contained in:
committed by
Peli de Halleux
parent
2352102dc5
commit
ce7ff4b7a6
@ -12,11 +12,11 @@ input.buttonIsPressed(Button.A);
|
||||
|
||||
## Returns
|
||||
|
||||
* [Boolean](/blocks/logic/boolean) that is `true` if the button you are checking is pressed, `false` if it is not pressed.
|
||||
* a [boolean](/blocks/logic/boolean) value that is `true` if the button you are checking is pressed, `false` if it is not pressed.
|
||||
|
||||
## Example
|
||||
|
||||
This program uses an [if](/blocks/logic/if) to run
|
||||
This program uses an [``||logic:if||``](/blocks/logic/if) to run
|
||||
one part of the program if the `A` button is pressed, and
|
||||
another part if it is not pressed.
|
||||
|
||||
@ -25,14 +25,18 @@ basic.forever(() => {
|
||||
let pressed = input.buttonIsPressed(Button.A)
|
||||
if (pressed) {
|
||||
// this part runs if the A button is pressed
|
||||
basic.showNumber(1, 150)
|
||||
basic.showNumber(1)
|
||||
} else {
|
||||
// this part runs if the A button is *not* pressed
|
||||
basic.showNumber(0, 150)
|
||||
basic.showNumber(0)
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
Find out how buttons provide input to the @boardname@ in this video:
|
||||
|
||||
https://www.youtube.com/watch?v=t_Qujjd_38o
|
||||
|
||||
## See also
|
||||
|
||||
[on button pressed](/reference/input/on-button-pressed), [if](/blocks/logic/if), [forever](/reference/basic/forever)
|
||||
|
Reference in New Issue
Block a user