pxt-microbit 7.1.31 → 7.1.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/built/block-tests.js +1 -1
- package/built/hexcache/09c1ed868d7d8b474313e6abc88c7a9bede0ca376a507a97886137e8d91372e9.hex +20312 -0
- package/built/hexcache/ba843ecd090c93546c91118ee212273e7b1e104915bfd9146cb18fa1a1c826a6.hex +19712 -0
- package/built/target.js +1 -1
- package/built/target.json +1 -1
- package/built/targetlight.js +1 -1
- package/built/targetlight.json +1 -1
- package/built/web/blockly.css +1 -1
- package/built/web/react-common-authcode.css +1 -1
- package/built/web/react-common-multiplayer.css +1 -1
- package/built/web/react-common-skillmap.css +1 -1
- package/built/web/rtlblockly.css +1 -1
- package/built/web/rtlreact-common-authcode.css +1 -1
- package/built/web/rtlreact-common-multiplayer.css +1 -1
- package/built/web/rtlreact-common-skillmap.css +1 -1
- package/built/web/rtlsemantic.css +1 -1
- package/built/web/semantic.css +1 -1
- package/docs/jacdac.md +1 -2
- package/docs/projects/v2-blow-away.md +34 -34
- package/docs/projects/v2-cat-napping.md +24 -24
- package/docs/projects/v2-clap-lights.md +14 -14
- package/docs/projects/v2-countdown.md +15 -15
- package/docs/projects/v2-morse-chat.md +22 -22
- package/docs/projects/v2-pet-hamster.md +11 -11
- package/docs/projects/v2-play-sound-long.md +3 -3
- package/docs/projects/v2-play-sound.md +2 -2
- package/docs/reference/basic/show-leds.md +7 -3
- package/docs/reference/control/hardware-version.md +10 -2
- package/docs/reference/control.md +0 -1
- package/docs/reference/input/running-time-micros.md +25 -7
- package/docs/reference/input/running-time.md +5 -5
- package/docs/reference/radio/on-data-received.md +3 -3
- package/docs/reference/radio/on-received-buffer.md +2 -2
- package/docs/reference/radio/on-received-number.md +4 -2
- package/docs/reference/radio/on-received-string.md +4 -2
- package/docs/reference/radio/on-received-value.md +4 -2
- package/docs/reference/radio/receive-number.md +3 -3
- package/docs/reference/radio/receive-string.md +3 -3
- package/docs/reference/text.md +1 -18
- package/package.json +2 -2
- package/pxtarget.json +1 -1
- package/built/hexcache/48e233a9e7cb064a9fd68e54c8beff5205dcaa75438efd3aa80b5a8d8b2193b0.hex +0 -19728
- package/built/hexcache/f4ded62c04894faf19f0b018903924088e6564165ff2e1ed59d299b7cde3edef.hex +0 -20330
- /package/built/hexcache/{e756ebe5395e9c7bafe42fe3530efbbbd08f187c6520ef35cf2180fd93231311.hex → 01fcf2f97a9eaeefd82a2ddaa0ca451b2500ff47b8dc92db69fda37deeb1b910.hex} +0 -0
- /package/built/hexcache/{6eb54784e9979c4bc09fc35851ef21b114be086c997f8e82c25fe66fee647fb6.hex → 0ddbecb007986045d0daa6818b319bdc1d05397d2b57d117798c64695cdc9d23.hex} +0 -0
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
Cyrus is a very sleepy hamster. In fact, Cyrus is almost always sleeping.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
■ From the ``||basic:Basic||`` category, find ``||basic:show icon [ ]||`` and snap it into your ``||basic:on start||`` container. Set it to show the asleep ``-_-`` face.
|
|
12
12
|
💡 In the ``show icon`` dropdown menu options, you can hover to see what each design is called!
|
|
13
13
|
|
|
14
14
|
```blocks
|
|
@@ -20,8 +20,8 @@ basic.showIcon(IconNames.Asleep)
|
|
|
20
20
|
|
|
21
21
|
Pressing Cyrus's logo tickles them!
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
■ From ``||input:Input||``, find the ``||input:on logo [pressed]||`` container and drag it into your workspace.
|
|
24
|
+
■ Go to ``||basic:Basic||`` and grab **another** ``||basic:show icon [ ]||``. Snap it into your **empty** ``||input(noclick):on logo [pressed]||`` container. Set the icon (Cyrus's face) to happy ``:)``.
|
|
25
25
|
|
|
26
26
|
```blocks
|
|
27
27
|
//@highlight
|
|
@@ -33,7 +33,7 @@ input.onLogoEvent(TouchButtonEvent.Pressed, function () {
|
|
|
33
33
|
|
|
34
34
|
## {Tickle sound}
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
■ From the ``||music:Music||`` category, get a ``||music:play [melody jump up] [in background]||`` and add it to the **bottom** of your ``||input(noclick):on logo [pressed]||`` container. Change the playback mode to ``||music(noclick):[until done]||``.
|
|
37
37
|
|
|
38
38
|
```blocks
|
|
39
39
|
input.onLogoEvent(TouchButtonEvent.Pressed, function () {
|
|
@@ -47,8 +47,8 @@ input.onLogoEvent(TouchButtonEvent.Pressed, function () {
|
|
|
47
47
|
|
|
48
48
|
Whenever Cyrus is shaken, they get sad 🙁
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
■ From ``||input:Input||``, find ``||input:on [shake]||`` and drag it into your workspace.
|
|
51
|
+
■ From the ``||basic:Basic||`` category, grab ``||basic:show icon [ ]||`` and snap it into your **new** ``||input(noclick):on [shake]||`` container. Set the icon (Cyrus's face) to sad ``:(``.
|
|
52
52
|
|
|
53
53
|
```blocks
|
|
54
54
|
//@highlight
|
|
@@ -60,8 +60,8 @@ input.onGesture(Gesture.Shake, function () {
|
|
|
60
60
|
|
|
61
61
|
## {Dizzy sound}
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
■ From the ``||music:Music||`` category, find the ``||music:play [melody dadadum] [in background]||`` block and add it to the **bottom** of your ``||input(noclick):on [shake]||`` container. Change the playback mode to ``||music(noclick):[until done]||``.
|
|
64
|
+
■ Click on the **dropdown** and set it so Cyrus plays a sad sound until done.
|
|
65
65
|
|
|
66
66
|
```blocks
|
|
67
67
|
input.onGesture(Gesture.Shake, function () {
|
|
@@ -75,8 +75,8 @@ input.onGesture(Gesture.Shake, function () {
|
|
|
75
75
|
|
|
76
76
|
Let's ensure that Cyrus will always go back to sleep after being shaken or tickled.
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
■ Right click the ``||basic(noclick):show icon[-_-]||`` block in your workspace (inside the ``||basic(noclick):on start||`` container) and choose **Duplicate**.
|
|
79
|
+
■ Snap your copied block in at the **very bottom** of your ``||input(noclick):on [shake]||`` container.
|
|
80
80
|
|
|
81
81
|
```blocks
|
|
82
82
|
input.onGesture(Gesture.Shake, function () {
|
|
@@ -94,7 +94,7 @@ basic.showIcon(IconNames.Asleep)
|
|
|
94
94
|
|
|
95
95
|
## {Cyrus's default face pt. 2}
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
■ Duplicate the ``||basic(noclick):show icon[-_-]||`` block again and this time snap it in at the **very bottom** of your ``||input(noclick):on logo [pressed]||`` container.
|
|
98
98
|
|
|
99
99
|
```blocks
|
|
100
100
|
input.onGesture(Gesture.Shake, function () {
|
|
@@ -18,7 +18,7 @@ Let's find out what numbers the micro:bit produces when you move it around.
|
|
|
18
18
|
⇼ Open the ``||serial:^ Advanced||`` category to show the ``||serial:Serial||`` label.
|
|
19
19
|
|
|
20
20
|
⇼ From ``||serial:Serial||``, drag the ``||serial:serial write value ["x"] = [0]||``
|
|
21
|
-
block into the ``||basic:forever||`` loop container.
|
|
21
|
+
block into the ``||basic(noclick):forever||`` loop container.
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -52,7 +52,7 @@ with the micro:bit **acceleration** value.
|
|
|
52
52
|
---
|
|
53
53
|
|
|
54
54
|
⇼ Open the ``||input:Input||`` category and drag ``||input:acceleration (mg) [x]||``
|
|
55
|
-
over to replace "0" in the ``||serial:serial write value ["x"] = [0]||``
|
|
55
|
+
over to replace "0" in the ``||serial(noclick):serial write value ["x"] = [0]||``
|
|
56
56
|
block.
|
|
57
57
|
|
|
58
58
|
⇼ Change "x" to "a" (for "acceleration".)
|
|
@@ -86,7 +86,7 @@ the micro:bit **acceleration** value.
|
|
|
86
86
|
---
|
|
87
87
|
|
|
88
88
|
⇼ Open the ``||input:Input||`` category and drag ``||input:acceleration (mg) [x]||``
|
|
89
|
-
over to replace "0" in the ``||serial:serial write value ["x"] = [0]||``
|
|
89
|
+
over to replace "0" in the ``||serial(noclick):serial write value ["x"] = [0]||``
|
|
90
90
|
block.
|
|
91
91
|
|
|
92
92
|
⇼ Change "x" to "a" (for "acceleration".)
|
|
@@ -16,7 +16,7 @@ To start your electronic beat, you'll want to repeat a sound forever.
|
|
|
16
16
|
---
|
|
17
17
|
|
|
18
18
|
⇼ Open the ``||music:Music||`` category and drag the ``||music:play sound [♫ ∿∿∿∿ +] [until done]||``
|
|
19
|
-
block into the empty ``||basic:forever||`` loop container.
|
|
19
|
+
block into the empty ``||basic(noclick):forever||`` loop container.
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
@@ -48,7 +48,7 @@ micro:bit **acceleration** value in the sound block.
|
|
|
48
48
|
|
|
49
49
|
---
|
|
50
50
|
|
|
51
|
-
⇼ On the ``||music:play sound [♫ ∿∿∿ +] [until done]||`` block, click the plus icon (**+**)
|
|
51
|
+
⇼ On the ``||music(noclick):play sound [♫ ∿∿∿ +] [until done]||`` block, click the plus icon (**+**)
|
|
52
52
|
to show the start frequency value of 5000.
|
|
53
53
|
|
|
54
54
|
⇼ From the ``||input:Input||`` category, drag the ``||input:acceleration (mg) [x]||``
|
|
@@ -19,11 +19,15 @@ basic.showLeds(`
|
|
|
19
19
|
* `interval` is an optional [number](/types/number) that means how many milliseconds to wait after showing a picture.
|
|
20
20
|
If you are programming with blocks, `interval` is set at 400 milliseconds.
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
### ~ hint
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
#### LED display
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
Watch this video to see how the @boardname@ shows numbers, text, and displays images with [LEDs](/reference/led).
|
|
27
|
+
|
|
28
|
+
https://www.youtube.com/watch?v=qqBmvHD5bCw
|
|
29
|
+
|
|
30
|
+
### ~
|
|
27
31
|
|
|
28
32
|
## Example
|
|
29
33
|
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
#
|
|
1
|
+
# hardware Version
|
|
2
2
|
|
|
3
|
-
Returns the major version of the
|
|
3
|
+
Returns a string containing the the major version and minor version of the @boardname@.
|
|
4
4
|
|
|
5
5
|
```sig
|
|
6
6
|
control.hardwareVersion()
|
|
7
7
|
```
|
|
8
|
+
|
|
9
|
+
## Returns
|
|
10
|
+
|
|
11
|
+
* a [string](/types/string) that contains the major and minor versions of the @boardname@. The string has an `"x.y"` format like `"1.5"`, `"2.1"`, or `"2.2"`.
|
|
12
|
+
|
|
13
|
+
## See also
|
|
14
|
+
|
|
15
|
+
[device name](/reference/control/device-name), [device serial number](/reference/control/device-serial-number)
|
|
@@ -1,17 +1,35 @@
|
|
|
1
|
-
#
|
|
1
|
+
# running Time Micros
|
|
2
2
|
|
|
3
|
-
Find how long
|
|
3
|
+
Find how long a program has run since it was started, in microseconds.
|
|
4
4
|
|
|
5
5
|
```sig
|
|
6
|
-
input.runningTimeMicros()
|
|
6
|
+
input.runningTimeMicros()
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
### ~ alert
|
|
10
|
+
|
|
11
|
+
#### Running time maximum count
|
|
12
|
+
|
|
13
|
+
The program running time counter can only count up to approximately 17 minutes of time (1,073,741,823 microseconds). After that, the running time will reset to zero and start counting up again.
|
|
14
|
+
|
|
15
|
+
Programs using the time counter should take this reset into account, even if they are only measuring short durations. The counter might reset while the program is running.
|
|
16
|
+
|
|
17
|
+
### ~
|
|
18
|
+
|
|
19
|
+
## Example
|
|
20
|
+
|
|
21
|
+
Pause for one second and then show the program running time on the screen.
|
|
22
|
+
|
|
23
|
+
```blocks
|
|
24
|
+
basic.pause(1000)
|
|
25
|
+
basic.showNumber(input.runningTimeMicros())
|
|
7
26
|
```
|
|
8
27
|
|
|
9
28
|
## Returns
|
|
10
29
|
|
|
11
|
-
* the [
|
|
12
|
-
(One second is
|
|
30
|
+
* the [number](/types/number) of microseconds since the program started.
|
|
31
|
+
(One second is 1,000,000 microseconds.)
|
|
13
32
|
|
|
14
33
|
## See also
|
|
15
34
|
|
|
16
|
-
[show number](/reference/basic/show-number), [pause](/reference/basic/pause)
|
|
17
|
-
|
|
35
|
+
[show number](/reference/basic/show-number), [pause](/reference/basic/pause), [running time](/reference/input/running-time)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Running Time
|
|
2
2
|
|
|
3
|
-
Find how long
|
|
3
|
+
Find how long a program has run since it was started, in milliseconds.
|
|
4
4
|
|
|
5
5
|
```sig
|
|
6
|
-
input.runningTime()
|
|
6
|
+
input.runningTime()
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
## Returns
|
|
@@ -13,12 +13,12 @@ input.runningTime();
|
|
|
13
13
|
|
|
14
14
|
## Example: elapsed time
|
|
15
15
|
|
|
16
|
-
When you press button `B` on the
|
|
16
|
+
When you press button `B` on the @boardname@, this
|
|
17
17
|
program finds the number of milliseconds since the program started
|
|
18
18
|
and shows it on the [LED screen](/device/screen).
|
|
19
19
|
|
|
20
20
|
```blocks
|
|
21
|
-
input.onButtonPressed(Button.B, ()
|
|
21
|
+
input.onButtonPressed(Button.B, function() {
|
|
22
22
|
let now = input.runningTime()
|
|
23
23
|
basic.showNumber(now)
|
|
24
24
|
})
|
|
@@ -27,5 +27,5 @@ input.onButtonPressed(Button.B, () => {
|
|
|
27
27
|
|
|
28
28
|
## See also
|
|
29
29
|
|
|
30
|
-
[show number](/reference/basic/show-number), [pause](/reference/basic/pause)
|
|
30
|
+
[show number](/reference/basic/show-number), [pause](/reference/basic/pause), [running time micros](/reference/input/running-time-micros)
|
|
31
31
|
|
|
@@ -7,13 +7,13 @@ Run part of a program when the @boardname@ receives a
|
|
|
7
7
|
radio.onDataReceived(() => { });
|
|
8
8
|
```
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
### ~ alert
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
#### Deprecated API
|
|
13
13
|
|
|
14
14
|
This API has been deprecated! Use [on received number](/reference/radio/on-received-number) instead.
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
### ~
|
|
17
17
|
|
|
18
18
|
```sig
|
|
19
19
|
radio.onDataReceived(() => { });
|
|
@@ -11,13 +11,15 @@ radio.onReceivedNumber(function (receivedNumber) {})
|
|
|
11
11
|
|
|
12
12
|
* **receivedNumber**: The [number](/types/number) that was sent in this packet or `0` if this packet did not contain a number. See [send number](/reference/radio/send-number) and [send value](/reference/radio/send-value)
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
### ~ hint
|
|
15
|
+
|
|
16
|
+
#### @boardname@ radio
|
|
15
17
|
|
|
16
18
|
Watch this video to see how the radio hardware works on the @boardname@:
|
|
17
19
|
|
|
18
20
|
https://www.youtube.com/watch?v=Re3H2ISfQE8
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
### ~
|
|
21
23
|
|
|
22
24
|
## Examples
|
|
23
25
|
|
|
@@ -10,13 +10,15 @@ radio.onReceivedString(function (receivedString) {})
|
|
|
10
10
|
|
|
11
11
|
* **receivedString**: The [string](/types/string) that was sent in this packet or the empty string if this packet did not contain a string. See [send string](/reference/radio/send-string) and [send value](/reference/radio/send-value)
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
### ~ hint
|
|
14
|
+
|
|
15
|
+
#### @boardname@ radio
|
|
14
16
|
|
|
15
17
|
Watch this video to see how the radio hardware works on the @boardname@:
|
|
16
18
|
|
|
17
19
|
https://www.youtube.com/watch?v=Re3H2ISfQE8
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
### ~
|
|
20
22
|
|
|
21
23
|
## Example
|
|
22
24
|
|
|
@@ -11,13 +11,15 @@ radio.onReceivedValue(function (name, value) {})
|
|
|
11
11
|
* **name**: a [string](/types/string) that is a name for the value received.
|
|
12
12
|
* **value**: a [number](/types/number) that is the value received.
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
### ~ hint
|
|
15
|
+
|
|
16
|
+
#### @boardname@ radio
|
|
15
17
|
|
|
16
18
|
Watch this video to see how the radio hardware works on the @boardname@:
|
|
17
19
|
|
|
18
20
|
https://www.youtube.com/watch?v=Re3H2ISfQE8
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
### ~
|
|
21
23
|
|
|
22
24
|
## Example
|
|
23
25
|
|
|
@@ -6,13 +6,13 @@ Receive the next number sent by a @boardname@ in the same ``radio`` group.
|
|
|
6
6
|
radio.receiveNumber();
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### ~ alert
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
#### Deprecated API
|
|
12
12
|
|
|
13
13
|
This API has been deprecated! Use [on received number](/reference/radio/on-received-number) instead.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
### ~
|
|
16
16
|
|
|
17
17
|
## Returns
|
|
18
18
|
|
|
@@ -5,13 +5,13 @@ Find the next string sent by radio from another @boardname@.
|
|
|
5
5
|
```sig
|
|
6
6
|
radio.receiveString()
|
|
7
7
|
```
|
|
8
|
-
|
|
8
|
+
### ~ alert
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
#### Deprecated
|
|
11
11
|
|
|
12
12
|
This API has been deprecated! Use [on received string](/reference/radio/on-received-string) instead.
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
### ~
|
|
15
15
|
|
|
16
16
|
## Returns
|
|
17
17
|
|
package/docs/reference/text.md
CHANGED
|
@@ -1,18 +1 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
Functions to combine, split, search, and convert text strings.
|
|
4
|
-
|
|
5
|
-
```cards
|
|
6
|
-
"".charAt(0);
|
|
7
|
-
"".compare("");
|
|
8
|
-
"".substr(0, 0);
|
|
9
|
-
parseFloat("");
|
|
10
|
-
parseInt("");
|
|
11
|
-
convertToText(0);
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
## See also
|
|
15
|
-
|
|
16
|
-
[char at](/reference/text/char-at), [compare](/reference/text/compare),
|
|
17
|
-
[substr](/reference/text/substr), [parse int](/reference/text/parse-int),
|
|
18
|
-
[parse float](/reference/text/parse-float), [convert to text](/reference/text/convert-text)
|
|
1
|
+
# @extends
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pxt-microbit",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.34",
|
|
4
4
|
"description": "micro:bit target for Microsoft MakeCode (PXT)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"JavaScript",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"pxt-common-packages": "12.3.30",
|
|
49
|
-
"pxt-core": "11.4.
|
|
49
|
+
"pxt-core": "11.4.22"
|
|
50
50
|
},
|
|
51
51
|
"overrides": {
|
|
52
52
|
"@blockly/field-colour": {
|
package/pxtarget.json
CHANGED