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:
parent
2352102dc5
commit
ce7ff4b7a6
@ -37,4 +37,4 @@
|
||||
"imageUrl": "/static/mb/behindhardware/temperature-sensor.jpg"
|
||||
}
|
||||
]
|
||||
```
|
||||
```
|
@ -20,6 +20,11 @@ They can be set to on/off and the brightness can be controlled.
|
||||
The yellow light on the back of the micro:bit is the status LED.
|
||||
It flashes yellow when the system wants to tell the user that something has happened.
|
||||
|
||||
See how the @boardname@ shows numbers, text, and displays images by watching this video about LEDs:
|
||||
|
||||
https://www.youtube.com/watch?v=qqBmvHD5bCw
|
||||
|
||||
|
||||
## Buttons
|
||||
|
||||
Buttons A and B are a form of input. When you press a button, it completes an electrical circuit.
|
||||
@ -29,6 +34,10 @@ to act on these events.
|
||||
Button R on the back of the micro:bit is a system button. It has different uses.
|
||||
When you have downloaded and run your code onto your micro:bit, press Button R to restart and run your program from the beginning.
|
||||
|
||||
Find out how buttons provide input to the @boardname@ in this video:
|
||||
|
||||
https://www.youtube.com/watch?v=t_Qujjd_38o
|
||||
|
||||
## USB connection
|
||||
|
||||
When you plug in your micro:bit via [USB](/device/usb), it should appear as a ``MICROBIT`` drive.
|
||||
@ -62,6 +71,10 @@ There is an accelerometer on your micro:bit which detects changes in the micro:b
|
||||
It converts analogue information into digital form that can be used in micro:bit programs.
|
||||
Output is in milli-g. The device will also detect a small number of standard actions e.g. shake, tilt and free-fall.
|
||||
|
||||
Watch this video to learn how the accelerometer works:
|
||||
|
||||
https://www.youtube.com/watch?v=byngcwjO51U
|
||||
|
||||
## Pins
|
||||
|
||||
The [pins](/device/pins) can be a form of electrical input or output.
|
||||
@ -71,6 +84,18 @@ There are labels for the input/output pins ``P0``, ``P1``, ``P2``, which you can
|
||||
|
||||
The screen can also be used a light level sensor (it's a really cool trick).
|
||||
|
||||
Learn more about how light level is detected in this light sensor video:
|
||||
|
||||
https://www.youtube.com/watch?v=TKhCr-dQMBY
|
||||
|
||||
## Temperature
|
||||
|
||||
Temperatrue is measured on the @boardname@ by detecting how hot its physical CPU material is. Since it operates nearly as cool as the air around it, the temperature it measures for itself is a good approximation for the ambient temperature (the temperature near and around it).
|
||||
|
||||
See how the @boardname@ can detect hot or cold in this temperature sensing video:
|
||||
|
||||
https://www.youtube.com/watch?v=_T4N8O9xsMA
|
||||
|
||||
## Runtime
|
||||
|
||||
The micro:bit embodies many fundamental concepts in computer science. To learn more, read [the micro:bit - a reactive system](/device/reactive).
|
||||
|
@ -19,6 +19,12 @@ basic.showLeds(`
|
||||
* `interval` is an optional [number](/types/number) that means how many milliseconds to wait after showing a picture.
|
||||
If you are programming with blocks, `interval` is set at 400 milliseconds.
|
||||
|
||||
## ~ hint
|
||||
|
||||
See how the @boardname@ shows numbers, text, and displays images by watching this video about [LEDs](https://www.youtube.com/watch?v=qqBmvHD5bCw).
|
||||
|
||||
## ~
|
||||
|
||||
## Example
|
||||
|
||||
This program shows a picture with the ``show leds`` function.
|
||||
|
@ -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.
|
||||
|
@ -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)
|
||||
|
@ -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).
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
||||
## ~
|
||||
|
||||
|
@ -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.
|
||||
|
@ -12,16 +12,11 @@ led.plotBrightness(0, 0, 255)
|
||||
led.setBrightness(255);
|
||||
led.stopAnimation();
|
||||
led.plotBarGraph(0, 0);
|
||||
led.fadeIn();
|
||||
led.fadeOut();
|
||||
led.plotAll();
|
||||
led.screenshot();
|
||||
led.toggleAll();
|
||||
led.setDisplayMode(DisplayMode.BackAndWhite);
|
||||
led.enable(false)
|
||||
```
|
||||
|
||||
## See Also
|
||||
|
||||
[plot](/reference/led/plot), [unplot](/reference/led/unplot), [point](/reference/led/point), [brightness](/reference/led/brightness), [setBrightness](/reference/led/set-brightness), [stopAnimation](/reference/led/stop-animation), [plotBarGraph](/reference/led/plot-bar-graph), [fadeIn](/reference/led/fade-in), [fadeOut](/reference/led/fade-out), [plotAll](/reference/led/plot-all), [screenshot](/reference/led/screenshot), [toggle](/reference/led/toggle), [toggleAll](/reference/led/toggle-all), [setDisplayMode](/reference/led/set-display-mode), [enabled](/reference/led/enable),
|
||||
[plot](/reference/led/plot), [unplot](/reference/led/unplot), [point](/reference/led/point), [brightness](/reference/led/brightness), [setBrightness](/reference/led/set-brightness), [stopAnimation](/reference/led/stop-animation), [plotBarGraph](/reference/led/plot-bar-graph), [toggle](/reference/led/toggle), [setDisplayMode](/reference/led/set-display-mode), [enabled](/reference/led/enable),
|
||||
[plotBrightness](/reference/led/plot-brightness),
|
||||
|
Loading…
Reference in New Issue
Block a user