From a4a37f10acbf05e062e697d3fd9493a366eb610d Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Mon, 16 Dec 2019 21:24:40 -0800 Subject: [PATCH 1/2] adding radio firefly (#2549) --- targetconfig.json | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/targetconfig.json b/targetconfig.json index a8540ce0..e92d18f7 100644 --- a/targetconfig.json +++ b/targetconfig.json @@ -1,18 +1,20 @@ { "packages": { "approvedRepos": [ - "Microsoft/pxt-neopixel", - "Microsoft/pxt-microturtle", - "Microsoft/pxt-sonar", - "Microsoft/pxt-hacking-stem", - "Microsoft/pxt-bluetooth-temperature-sensor", - "Microsoft/pxt-bluetooth-midi", - "Microsoft/pxt-max6675", - "Microsoft/pxt-midi", - "Microsoft/pxt-radio-blockchain", - "Microsoft/pxt-bluetooth-max6675", - "Microsoft/pxt-filesystem", - "Microsoft/pxt-ws2812b", + "microsoft/pxt-neopixel", + "microsoft/pxt-microturtle", + "microsoft/pxt-sonar", + "microsoft/pxt-hacking-stem", + "microsoft/pxt-bluetooth-temperature-sensor", + "microsoft/pxt-bluetooth-midi", + "microsoft/pxt-max6675", + "microsoft/pxt-midi", + "microsoft/pxt-radio-blockchain", + "microsoft/pxt-bluetooth-max6675", + "microsoft/pxt-filesystem", + "microsoft/pxt-ws2812b", + "microsoft/pxt-apa102", + "microsoft/pxt-radio-firefly", "KitronikLtd/pxt-kitronik-servo-lite", "KitronikLtd/pxt-kitronik-motor-driver", "KitronikLtd/pxt-kitronik-I2C-16-servo", From db9e8344049033eb3d89221033ffcd8aea623f03 Mon Sep 17 00:00:00 2001 From: Galen Nickel Date: Mon, 16 Dec 2019 21:25:19 -0800 Subject: [PATCH 2/2] Update 'Metal Detector' example (#2559) --- docs/reference/input/calibrate-compass.md | 2 +- docs/reference/input/compass-heading.md | 11 ++++++----- docs/reference/input/magnetic-force.md | 20 ++++++++++---------- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/docs/reference/input/calibrate-compass.md b/docs/reference/input/calibrate-compass.md index 673fd554..6096a82b 100644 --- a/docs/reference/input/calibrate-compass.md +++ b/docs/reference/input/calibrate-compass.md @@ -30,4 +30,4 @@ input.onButtonPressed(Button.AB, () => { ## See also -[compassHeading](/reference/input/compass-heading) +[compass heading](/reference/input/compass-heading) diff --git a/docs/reference/input/compass-heading.md b/docs/reference/input/compass-heading.md index 849bbafe..5696c29e 100644 --- a/docs/reference/input/compass-heading.md +++ b/docs/reference/input/compass-heading.md @@ -56,10 +56,11 @@ basic.forever(() => { ## Calibration -Every time you start to use the compass (for example, if you have just -turned the @boardname@ on), the @boardname@ will start to [calibrateCompass](/reference/input/calibrate-compass) -(adjust itself). It will ask you to draw a circle by tilting the -@boardname@. +Every time you start to use the compass (for example, if you have just turned the @boardname@ on), +the @boardname@ will start a [calibrate compass](/reference/input/calibrate-compass) +(adjust itself). +The [calibration step](https://support.microbit.org/support/solutions/articles/19000008874-calibrating-the-micro-bit-compass) +will ask you to draw a fill pattern on the screen by tilting the @boardname@. If you are calibrating or using the compass near metal, it might confuse the @boardname@. @@ -78,4 +79,4 @@ input.onButtonPressed(Button.AB, () => { ## See also -[acceleration](/reference/input/acceleration), [calibrateCompass](/reference/input/calibrate-compass) +[acceleration](/reference/input/acceleration), [calibrate compass](/reference/input/calibrate-compass) diff --git a/docs/reference/input/magnetic-force.md b/docs/reference/input/magnetic-force.md index 14373484..7c1b72f7 100644 --- a/docs/reference/input/magnetic-force.md +++ b/docs/reference/input/magnetic-force.md @@ -1,6 +1,6 @@ # Magnetic Force -Find the amount of magnetic force (the strength of a magnet) in the direction you say. +Find the amount of magnetic force (the strength of a magnet) in one of the three directions. ```sig input.magneticForce(Dimension.X); @@ -10,12 +10,14 @@ input.magneticForce(Dimension.X); The @boardname@ measures magnetic force with **microteslas**. -## ~ +You are asked to [calibrate](https://support.microbit.org/support/solutions/articles/19000008874-calibrating-the-micro-bit-compass) the compass the first time run a program +that uses the compass. +## ~ ## Parameters -* ``dimension`` means which direction the @boardname@ should measure +* **dimension**: this is the direction the @boardname@ should measure magnetic force in: either `Dimension.X` (the left-right direction), `Dimension.Y` (the forward/backward direction), or `Dimension.Z` (the up/down direction) @@ -24,16 +26,14 @@ The @boardname@ measures magnetic force with **microteslas**. * a [number](/types/number) of microteslas that means the strength of the magnet -## Example: metal detector +## Example -This program makes the center LED of the @boardname@ get brighter when -the magnetic force is stronger, and dimmer when it is weaker. +Create a metal detector my measuring the strength of magnetic force in the `X` direction. +Display a bar graph to show the current level of magnetic force measured by the magnetometer. ```blocks -led.plot(2, 2) -basic.forever(() => { - let f = input.magneticForce(Dimension.X) - led.setBrightness(f / 2000) +basic.forever(function() { + led.plotBarGraph(input.magneticForce(Dimension.X) / 2000, 0) }) ```