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:
Galen Nickel
2019-02-08 13:48:49 -08:00
committed by Peli de Halleux
parent 2352102dc5
commit ce7ff4b7a6
10 changed files with 62 additions and 13 deletions

View File

@ -15,6 +15,10 @@ A **g** is as much acceleration as you get from Earth's gravity.
## ~
Watch this video to learn how the accelerometer on the @boardname@ works:
https://www.youtube.com/watch?v=byngcwjO51U
## Parameters
* **dimension**: the direction you are checking for acceleration, or the total strength of force.

View File

@ -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)

View File

@ -14,6 +14,10 @@ has to be turned on first.
input.lightLevel();
```
Learn more about how light level is detected in this light sensor video:
https://www.youtube.com/watch?v=TKhCr-dQMBY.
## Returns
* a [Number](/types/number) that means a light level from ``0`` (dark) to ``255`` (bright).

View File

@ -12,6 +12,10 @@ on the @boardname@.
input.onButtonPressed(Button.A, () => {})
```
Find out how buttons provide input to the @boardname@ in this video:
https://www.youtube.com/watch?v=t_Qujjd_38o
## Example: count button clicks
This example counts how many times you press the `A` button.

View File

@ -9,7 +9,9 @@ input.rotation(Rotation.Roll);
## ~hint
The @boardname@ has a part called the **accelerometer** that can
check how the @boardname@ is moving.
check how the @boardname@ is moving. Watch this video to learn how the accelerometer works:
https://www.youtube.com/watch?v=byngcwjO51U
## ~

View File

@ -9,7 +9,7 @@ input.temperature();
## Returns
* a [Number](/types/number) that means the Celsius temperature.
* a [number](/types/number) that is the temperature in degrees Celsius.
## How does it work?
@ -18,6 +18,11 @@ Because the @boardname@ does not usually get very hot, the temperature of the CP
is usually close to the temperature of wherever you are.
The @boardname@ might warm up a little if you make it work hard, though!
Learn more about how the @boardname@ can detect hot or cold in this video:
https://www.youtube.com/watch?v=_T4N8O9xsMA
## Example: @boardname@ thermometer
The following example uses `temperature` and `show number` to show the temperature of the room.