From ce7ff4b7a6e9510d1bd140440fb5b7d192734fbe Mon Sep 17 00:00:00 2001 From: Galen Nickel Date: Fri, 8 Feb 2019 13:48:49 -0800 Subject: [PATCH] Add some linking for hw vids (#1813) * add linking for hw vids, fix card pages * revert vid card page and inline youtube links --- docs/behind-the-makecode-hardware.md | 2 +- docs/device.md | 25 +++++++++++++++++++++++ docs/reference/basic/show-leds.md | 6 ++++++ docs/reference/input/acceleration.md | 4 ++++ docs/reference/input/button-is-pressed.md | 12 +++++++---- docs/reference/input/light-level.md | 4 ++++ docs/reference/input/on-button-pressed.md | 4 ++++ docs/reference/input/rotation.md | 4 +++- docs/reference/input/temperature.md | 7 ++++++- docs/reference/led.md | 7 +------ 10 files changed, 62 insertions(+), 13 deletions(-) diff --git a/docs/behind-the-makecode-hardware.md b/docs/behind-the-makecode-hardware.md index 49f2e900..2e93f82c 100644 --- a/docs/behind-the-makecode-hardware.md +++ b/docs/behind-the-makecode-hardware.md @@ -37,4 +37,4 @@ "imageUrl": "/static/mb/behindhardware/temperature-sensor.jpg" } ] -``` +``` \ No newline at end of file diff --git a/docs/device.md b/docs/device.md index c935c89d..f5bd9d1d 100644 --- a/docs/device.md +++ b/docs/device.md @@ -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). diff --git a/docs/reference/basic/show-leds.md b/docs/reference/basic/show-leds.md index 0126da27..7125078b 100644 --- a/docs/reference/basic/show-leds.md +++ b/docs/reference/basic/show-leds.md @@ -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. diff --git a/docs/reference/input/acceleration.md b/docs/reference/input/acceleration.md index c4bb51a0..83b35731 100644 --- a/docs/reference/input/acceleration.md +++ b/docs/reference/input/acceleration.md @@ -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. diff --git a/docs/reference/input/button-is-pressed.md b/docs/reference/input/button-is-pressed.md index ad851e93..c75136bb 100644 --- a/docs/reference/input/button-is-pressed.md +++ b/docs/reference/input/button-is-pressed.md @@ -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) diff --git a/docs/reference/input/light-level.md b/docs/reference/input/light-level.md index 25bc48c7..558aab08 100644 --- a/docs/reference/input/light-level.md +++ b/docs/reference/input/light-level.md @@ -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). diff --git a/docs/reference/input/on-button-pressed.md b/docs/reference/input/on-button-pressed.md index fe5bc1f1..9ffb7878 100644 --- a/docs/reference/input/on-button-pressed.md +++ b/docs/reference/input/on-button-pressed.md @@ -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. diff --git a/docs/reference/input/rotation.md b/docs/reference/input/rotation.md index 81ae4bd5..a4e9cb6c 100644 --- a/docs/reference/input/rotation.md +++ b/docs/reference/input/rotation.md @@ -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 ## ~ diff --git a/docs/reference/input/temperature.md b/docs/reference/input/temperature.md index 686bd9e0..e068a9f7 100644 --- a/docs/reference/input/temperature.md +++ b/docs/reference/input/temperature.md @@ -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. diff --git a/docs/reference/led.md b/docs/reference/led.md index 27f02397..62047417 100644 --- a/docs/reference/led.md +++ b/docs/reference/led.md @@ -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),