pxt-microbit 7.0.13 → 7.0.14
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/common-sim.js +5 -5
- package/built/hexcache/{cb1b89b5febf846e20413f33f34b0649f662c6c856cdfc30b0bc766a37cf0dfa.hex → 0732e6383c21bfe20c40a8e9fe3784db8f5d85289bc7496a4366a5dce01f197c.hex} +6750 -6750
- package/built/hexcache/{d9847d963d09454741232337ee6d32ba4a4de678d0995b2829ed46157276a5b2.hex → 2f49babe14d51d847bde5c10754a0acb03db2bb140b9e84b3be886621d6ecc29.hex} +7213 -7213
- package/built/hexcache/68c1d66616cdc9b29dab3af0dee93deac852344f969783fe2f39c9758791337a.hex +19720 -0
- package/built/hexcache/d7311504e3fadadd391f7e3b175d0bf532c9352419f404676608d2417c615cbc.hex +20321 -0
- package/built/sim.d.ts +7 -2
- package/built/sim.js +102 -40
- package/built/target-strings.json +1 -1
- package/built/target.js +1 -1
- package/built/target.json +1 -1
- package/built/targetlight.json +1 -1
- package/built/web/rtlsemantic.css +3 -3
- package/built/web/semantic.css +3 -3
- package/docs/courses.md +1 -1
- package/docs/extensions/extension-gallery.md +17 -13
- package/docs/projects/SUMMARY.md +1 -1
- package/docs/projects/hot-potato.md +1 -1
- package/docs/projects/level.md +7 -7
- package/docs/projects/plot-acceleration.md +1 -1
- package/docs/projects/python/smiley-buttons.md +6 -10
- package/docs/projects/spy/7-seconds.md +9 -9
- package/docs/projects/spy/coin-flipper.md +8 -8
- package/docs/projects/spy/compass.md +9 -9
- package/docs/projects/spy/heads-guess.md +10 -10
- package/docs/projects/spy/hot-potato.md +8 -8
- package/docs/projects/spy/level.md +7 -7
- package/docs/projects/spy/stopwatch.md +7 -7
- package/docs/projects/spy/tug-of-led.md +8 -8
- package/docs/projects/stopwatch.md +8 -8
- package/docs/projects/tug-of-led.md +8 -8
- package/docs/projects/v2-play-sound.md +8 -8
- package/docs/reference/basic/show-arrow.md +2 -2
- package/docs/reference/basic/show-leds.md +1 -2
- package/docs/reference/basic/show-number.md +2 -3
- package/docs/reference/basic/show-string.md +2 -4
- package/docs/reference/game/clear.md +1 -1
- package/docs/reference/images/create-big-image.md +1 -1
- package/docs/reference/images/create-image.md +4 -5
- package/docs/reference/images/plot-frame.md +1 -1
- package/docs/reference/images/plot-image.md +1 -1
- package/docs/reference/images/scroll-image.md +1 -2
- package/docs/reference/images/show-frame.md +1 -1
- package/docs/reference/images/show-image.md +1 -1
- package/docs/reference/images/width.md +1 -2
- package/docs/reference/pins/set-audio-pin-enabled.md +38 -0
- package/docs/reference/pins/set-audio-pin.md +2 -1
- package/package.json +3 -3
- package/pxtarget.json +2 -1
- package/targetconfig.json +2 -1
- package/built/hexcache/0b0ef5aa10458cd792db8bb60d6016582a48904c3caf6491fee8c4fed1dcebe1.hex +0 -20347
- package/built/hexcache/2e8285fb3e0552598a6cfc14b7f1458b7a93baad71011f78c6f93598c5381e38.hex +0 -19748
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
This project turns the @boardname@ into a simple stopwatch. Pressing **A** starts the timer. Pressing **B** displays the elapsed seconds.
|
|
10
10
|
|
|
11
|
-
## Step 1
|
|
11
|
+
## {Step 1}
|
|
12
12
|
|
|
13
13
|
Add an event to run code when ``||input:button A is pressed||``.
|
|
14
14
|
|
|
@@ -17,7 +17,7 @@ input.onButtonPressed(Button.A, function () {
|
|
|
17
17
|
})
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
## Step 2
|
|
20
|
+
## {Step 2}
|
|
21
21
|
|
|
22
22
|
Add code inside the ``||input:button A is pressed||`` event to store the current
|
|
23
23
|
``||input:running time||`` in a variable ``||variables:start||``. This is the start time.
|
|
@@ -29,7 +29,7 @@ input.onButtonPressed(Button.A, function () {
|
|
|
29
29
|
})
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
## Step 3
|
|
32
|
+
## {Step 3}
|
|
33
33
|
|
|
34
34
|
Add another event to run code when ``||input:button B is pressed||``.
|
|
35
35
|
|
|
@@ -38,7 +38,7 @@ input.onButtonPressed(Button.B, function () {
|
|
|
38
38
|
})
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
## Step 4
|
|
41
|
+
## {Step 4}
|
|
42
42
|
|
|
43
43
|
Add code in that event to compute the difference between the ``||input:running time||``
|
|
44
44
|
and ``||variables:value||`` time. This is the elapsed number of milliseconds since
|
|
@@ -51,7 +51,7 @@ input.onButtonPressed(Button.B, function () {
|
|
|
51
51
|
})
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
## Step 5
|
|
54
|
+
## {Step 5}
|
|
55
55
|
|
|
56
56
|
After setting the ``||variables:elapsed||`` time, add code to ``||basic:show||`` the
|
|
57
57
|
number of milliseconds ``||variables:elapsed||``. Use ``||Math:integer division||`` to
|
|
@@ -65,11 +65,11 @@ input.onButtonPressed(Button.B, function () {
|
|
|
65
65
|
})
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
## Step 6
|
|
68
|
+
## {Step 6}
|
|
69
69
|
|
|
70
70
|
Try your program in the simulator. Press **A** to start the stopwatch and press **B** to get the
|
|
71
71
|
current elapsed time. You can press **B** multiple times.
|
|
72
72
|
|
|
73
|
-
## Step 7
|
|
73
|
+
## {Step 7}
|
|
74
74
|
|
|
75
75
|
If you have a @boardname@ connected, click ``|Download|`` to transfer your code!
|
|
@@ -9,7 +9,7 @@ Instead of a rope, we'll use the LED screen by pulling the LED light through the
|
|
|
9
9
|
|
|
10
10
|

|
|
11
11
|
|
|
12
|
-
## Step 1
|
|
12
|
+
## {Step 1}
|
|
13
13
|
|
|
14
14
|
Create a new variable ``||variables:rope||`` to track the progress of the game. The ``||variables:rope||``
|
|
15
15
|
variable will be used as the **x** coordinate of the LED to lit so we set it to ``2`` to start.
|
|
@@ -18,7 +18,7 @@ variable will be used as the **x** coordinate of the LED to lit so we set it to
|
|
|
18
18
|
let rope = 2
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
## Step 2
|
|
21
|
+
## {Step 2}
|
|
22
22
|
|
|
23
23
|
Add a ``||basic:forever||`` loop that turns on the LED at the position set in ``||variables:rope||``.
|
|
24
24
|
|
|
@@ -30,7 +30,7 @@ basic.forever(function() {
|
|
|
30
30
|
})
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
## Step 3
|
|
33
|
+
## {Step 3}
|
|
34
34
|
|
|
35
35
|
Add an event for ``||input:button A pressed||`` to change the ``||variables:rope||`` value by **-0.1**.
|
|
36
36
|
|
|
@@ -41,7 +41,7 @@ input.onButtonPressed(Button.A, function () {
|
|
|
41
41
|
})
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
## Step 4
|
|
44
|
+
## {Step 4}
|
|
45
45
|
|
|
46
46
|
Add an event on ``||input:button B pressed||`` to change the ``||variables:rope||`` value by **0.1**.
|
|
47
47
|
|
|
@@ -52,7 +52,7 @@ input.onButtonPressed(Button.B, function () {
|
|
|
52
52
|
})
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
## Step 5
|
|
55
|
+
## {Step 5}
|
|
56
56
|
|
|
57
57
|
Because a button press pulls the rope by **0.1** in either direction, plot the ``||math:rounded||`` value of ``||variables:rope||`` to the nearest LED.
|
|
58
58
|
|
|
@@ -64,7 +64,7 @@ basic.forever(function() {
|
|
|
64
64
|
})
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
-
## Step 6
|
|
67
|
+
## {Step 6}
|
|
68
68
|
|
|
69
69
|
Back in the ``||basic:forever||``, add code to test ``||logic:if||`` the ``||variables:rope||`` is negative
|
|
70
70
|
then ``||basic:show||`` **A WINS** on the screen.
|
|
@@ -81,7 +81,7 @@ basic.forever(function() {
|
|
|
81
81
|
})
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
-
## Step 7
|
|
84
|
+
## {Step 7}
|
|
85
85
|
|
|
86
86
|
Add an ``||logic:else if||`` condition to test ``||logic:if||`` the ``||variables:rope||`` is greater than `4`
|
|
87
87
|
then ``||basic:show||`` **B WINS** on the screen.
|
|
@@ -100,6 +100,6 @@ basic.forever(function() {
|
|
|
100
100
|
})
|
|
101
101
|
```
|
|
102
102
|
|
|
103
|
-
## Step 8
|
|
103
|
+
## {Step 8}
|
|
104
104
|
|
|
105
105
|
Find a friend and start button smashing!
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Stopwatch
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Time is ticking! @unplugged
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
7
7
|
This project turns the @boardname@ into a simple stopwatch. Pressing **A** starts the timer. Pressing **B** displays the elapsed seconds.
|
|
8
8
|
|
|
9
|
-
## Step 1
|
|
9
|
+
## {Step 1}
|
|
10
10
|
|
|
11
11
|
Use an event to run code when ``||input:button A is pressed||``.
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@ input.onButtonPressed(Button.A, function () {
|
|
|
15
15
|
})
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
## Step 2
|
|
18
|
+
## {Step 2}
|
|
19
19
|
|
|
20
20
|
Add code to store the current ``||input:running time||``
|
|
21
21
|
in a variable ``||variables:start||``. This is the start time.
|
|
@@ -27,7 +27,7 @@ input.onButtonPressed(Button.A, function () {
|
|
|
27
27
|
})
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
## Step 3
|
|
30
|
+
## {Step 3}
|
|
31
31
|
|
|
32
32
|
Add an event to run code when ``||input:button B is pressed||``.
|
|
33
33
|
|
|
@@ -36,7 +36,7 @@ input.onButtonPressed(Button.B, function () {
|
|
|
36
36
|
})
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
## Step 4
|
|
39
|
+
## {Step 4}
|
|
40
40
|
|
|
41
41
|
Add code to compute the difference between the ``||input:running time||``
|
|
42
42
|
and ``||variables:value||`` time. This is the elapsed millisecond since pressing button A.
|
|
@@ -48,7 +48,7 @@ input.onButtonPressed(Button.B, function () {
|
|
|
48
48
|
})
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
## Step 5
|
|
51
|
+
## {Step 5}
|
|
52
52
|
|
|
53
53
|
Add code to ``||basic:show||`` the number of milliseconds ``||variables:elapsed||``.
|
|
54
54
|
Use ``||Math:integer division||`` to divide ``||variables:elapsed||`` by ``1000`` and get seconds.
|
|
@@ -61,11 +61,11 @@ input.onButtonPressed(Button.B, function () {
|
|
|
61
61
|
})
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
-
## Step 6
|
|
64
|
+
## {Step 6}
|
|
65
65
|
|
|
66
66
|
Try your program in the simulator. Press **A** to start the stopwatch and press **B** to get the current elapsed time. You can press **B** multiple times.
|
|
67
67
|
|
|
68
|
-
## Step 7
|
|
68
|
+
## {Step 7}
|
|
69
69
|
|
|
70
70
|
If you have a @boardname@ connected, click ``|Download|`` to transfer your code!
|
|
71
71
|
|
|
@@ -7,7 +7,7 @@ Instead of a rope, we'll use the LED screen by pulling the LED light through the
|
|
|
7
7
|
|
|
8
8
|

|
|
9
9
|
|
|
10
|
-
## Step 1
|
|
10
|
+
## {Step 1}
|
|
11
11
|
|
|
12
12
|
Create a new variable ``||variables:rope||`` and put it in the ``||basic:on start||``. This will
|
|
13
13
|
track the progress of the game. The ``||variables:rope||`` variable will be used as the **x**
|
|
@@ -17,7 +17,7 @@ coordinate of the LED to lit so we set it to ``2`` to start.
|
|
|
17
17
|
let rope = 2
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
## Step 2
|
|
20
|
+
## {Step 2}
|
|
21
21
|
|
|
22
22
|
Add a ``||basic:forever||`` loop that turns on the LED at the ``||variables:rope||`` position.
|
|
23
23
|
|
|
@@ -29,7 +29,7 @@ basic.forever(function() {
|
|
|
29
29
|
})
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
## Step 3
|
|
32
|
+
## {Step 3}
|
|
33
33
|
|
|
34
34
|
Add an event on ``||input:button A pressed||`` to change the ``||variables:rope||`` value by **-0.1**.
|
|
35
35
|
|
|
@@ -40,7 +40,7 @@ input.onButtonPressed(Button.A, function () {
|
|
|
40
40
|
})
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
## Step 4
|
|
43
|
+
## {Step 4}
|
|
44
44
|
|
|
45
45
|
Add an event on ``||input:button B pressed||`` to change the ``||variables:rope||`` value by **0.1**.
|
|
46
46
|
|
|
@@ -50,7 +50,7 @@ input.onButtonPressed(Button.B, function () {
|
|
|
50
50
|
rope += 0.1
|
|
51
51
|
})
|
|
52
52
|
```
|
|
53
|
-
## Step 5
|
|
53
|
+
## {Step 5}
|
|
54
54
|
|
|
55
55
|
Because a button press pulls the rope by **0.1** in either direction, plot the ``||math:round||`` value of ``||variables:rope||`` to the nearest LED.
|
|
56
56
|
|
|
@@ -62,7 +62,7 @@ basic.forever(function() {
|
|
|
62
62
|
})
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
-
## Step 6
|
|
65
|
+
## {Step 6}
|
|
66
66
|
|
|
67
67
|
Back in the ``||basic:forever||``, add code to test ``||logic:if||`` the ``||variables:rope||`` is negative
|
|
68
68
|
then ``||basic:show||`` **A WINS** on the screen.
|
|
@@ -79,7 +79,7 @@ basic.forever(function() {
|
|
|
79
79
|
})
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
## Step 7
|
|
82
|
+
## {Step 7}
|
|
83
83
|
|
|
84
84
|
Add an ``||logic:else if||`` condition to test ``||logic:if||`` the ``||variables:rope||`` is greater than 4
|
|
85
85
|
then ``||basic:show||`` **B WINS** on the screen.
|
|
@@ -98,6 +98,6 @@ basic.forever(function() {
|
|
|
98
98
|
})
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
-
## Step 8
|
|
101
|
+
## {Step 8}
|
|
102
102
|
|
|
103
103
|
Find a friend and start button smashing!
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Dance to the Beat
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Introduction @unplugged
|
|
4
4
|
|
|
5
5
|
The new micro:bit has speakers so you can hear sounds without being tied down!
|
|
6
6
|
|
|
@@ -9,7 +9,7 @@ Let's use movement to create an electronic beat of our own.
|
|
|
9
9
|

|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Add Play Sound Block
|
|
13
13
|
|
|
14
14
|
To start your electronic beat, you'll want to repeat a sound forever.
|
|
15
15
|
|
|
@@ -28,7 +28,7 @@ basic.forever(function(){
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
##
|
|
31
|
+
## Listen Close
|
|
32
32
|
|
|
33
33
|
When your code runs again, you should hear a short laser/alarm
|
|
34
34
|
sound that repeats over and over forever.
|
|
@@ -41,7 +41,7 @@ sound that repeats over and over forever.
|
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
##
|
|
44
|
+
## Make a Change
|
|
45
45
|
|
|
46
46
|
For the sound to change with your speed of movement, we need to put the
|
|
47
47
|
micro:bit **acceleration** value in the sound block.
|
|
@@ -63,7 +63,7 @@ basic.forever(function(){
|
|
|
63
63
|
|
|
64
64
|
|
|
65
65
|
|
|
66
|
-
##
|
|
66
|
+
## Listen Again
|
|
67
67
|
|
|
68
68
|
Run your code again.
|
|
69
69
|
|
|
@@ -74,7 +74,7 @@ You should hear the sound change as the micro:bit moves.
|
|
|
74
74
|
|
|
75
75
|
|
|
76
76
|
|
|
77
|
-
##
|
|
77
|
+
## Rotation Values
|
|
78
78
|
|
|
79
79
|
You can make the beat even more fun by changing the end frequency as the micro:bit rotates.
|
|
80
80
|
|
|
@@ -92,7 +92,7 @@ basic.forever(function(){
|
|
|
92
92
|
|
|
93
93
|
|
|
94
94
|
|
|
95
|
-
##
|
|
95
|
+
## Listen Again
|
|
96
96
|
|
|
97
97
|
Run your code again.
|
|
98
98
|
|
|
@@ -108,7 +108,7 @@ Try moving the micro:bit in different ways. Can you make a fun beat?
|
|
|
108
108
|
|
|
109
109
|
|
|
110
110
|
|
|
111
|
-
##
|
|
111
|
+
## Customize Your Beat
|
|
112
112
|
|
|
113
113
|
Try changing the **duration** of the beat to something other than **500**. <br/>
|
|
114
114
|
Then, change the dropdown selection inside both the **acceleration** and **rotation**
|
|
@@ -43,10 +43,9 @@ If `value` is `NaN` (not a number), `?` is displayed.
|
|
|
43
43
|
|
|
44
44
|
## Other show functions
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
* Use [show animation](/reference/basic/show-animation) to show a group of pictures on the screen, one after another.
|
|
46
|
+
Use [show string](/reference/basic/show-string) to show a [String](/types/string) with letters on the screen.
|
|
48
47
|
|
|
49
48
|
## See also
|
|
50
49
|
|
|
51
|
-
[show string](/reference/basic/show-string), [
|
|
50
|
+
[show string](/reference/basic/show-string), [Number](/types/number), [math](/blocks/math)
|
|
52
51
|
|
|
@@ -28,10 +28,8 @@ basic.showString(s)
|
|
|
28
28
|
|
|
29
29
|
## Other show functions
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
* Use [show animation](/reference/basic/show-animation) to show a group of pictures on the screen, one after another.
|
|
31
|
+
Use [show number](/reference/basic/show-number) to show a number on the [LED screen](/device/screen).
|
|
33
32
|
|
|
34
33
|
## See also
|
|
35
34
|
|
|
36
|
-
[String](/types/string), [show number](/reference/basic/show-number)
|
|
37
|
-
|
|
35
|
+
[String](/types/string), [show number](/reference/basic/show-number)
|
|
@@ -35,5 +35,5 @@ input.onButtonPressed(Button.A, () => {
|
|
|
35
35
|
|
|
36
36
|
## See also
|
|
37
37
|
|
|
38
|
-
[Image](/reference/images/image), [show
|
|
38
|
+
[Image](/reference/images/image), [show image](/reference/images/show-image), [scroll image](/reference/images/scroll-image), [create image](/reference/images/create-image)
|
|
39
39
|
|
|
@@ -49,4 +49,4 @@ input.onButtonPressed(Button.B, () => {
|
|
|
49
49
|
[image](/reference/images/image),
|
|
50
50
|
[create image](/reference/images/create-image),
|
|
51
51
|
[show image](/reference/images/show-image),
|
|
52
|
-
[scroll image](/reference/images/scroll-image)
|
|
52
|
+
[scroll image](/reference/images/scroll-image)
|
|
@@ -32,7 +32,7 @@ input.onButtonPressed(Button.A, () => {
|
|
|
32
32
|
# . # . #
|
|
33
33
|
. . # . .
|
|
34
34
|
. . # . .
|
|
35
|
-
`).showImage(0)
|
|
35
|
+
`).showImage(0)
|
|
36
36
|
});
|
|
37
37
|
input.onButtonPressed(Button.B, () => {
|
|
38
38
|
images.createImage(`
|
|
@@ -41,8 +41,8 @@ input.onButtonPressed(Button.B, () => {
|
|
|
41
41
|
# . # . #
|
|
42
42
|
. # # # .
|
|
43
43
|
. . # . .
|
|
44
|
-
`).showImage(0)
|
|
45
|
-
})
|
|
44
|
+
`).showImage(0)
|
|
45
|
+
})
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
## See also
|
|
@@ -50,5 +50,4 @@ input.onButtonPressed(Button.B, () => {
|
|
|
50
50
|
[image](/reference/images/image),
|
|
51
51
|
[create big image](/reference/images/create-big-image),
|
|
52
52
|
[show image](/reference/images/show-image),
|
|
53
|
-
[scroll image](/reference/images/scroll-image)
|
|
54
|
-
|
|
53
|
+
[scroll image](/reference/images/scroll-image)
|
|
@@ -33,5 +33,5 @@ img.plotFrame(1)
|
|
|
33
33
|
|
|
34
34
|
## See also
|
|
35
35
|
|
|
36
|
-
[create image](/reference/images/create-image), [
|
|
36
|
+
[create image](/reference/images/create-image), [image](/reference/images/image), [show image](/reference/images/show-image), [scroll image](/reference/images/scroll-image)
|
|
37
37
|
|
|
@@ -33,5 +33,5 @@ img.plotImage(0)
|
|
|
33
33
|
|
|
34
34
|
## See also
|
|
35
35
|
|
|
36
|
-
[create image](/reference/images/create-image), [
|
|
36
|
+
[create image](/reference/images/create-image), [image](/reference/images/image), [show image](/reference/images/show-image), [scroll image](/reference/images/scroll-image)
|
|
37
37
|
|
|
@@ -46,5 +46,4 @@ basic.forever(() => {
|
|
|
46
46
|
|
|
47
47
|
## See also
|
|
48
48
|
|
|
49
|
-
[show image](/reference/images/show-image), [image](/reference/images/image), [create image](/reference/images/create-image)
|
|
50
|
-
|
|
49
|
+
[show image](/reference/images/show-image), [image](/reference/images/image), [create image](/reference/images/create-image)
|
|
@@ -33,5 +33,5 @@ img.showFrame(1)
|
|
|
33
33
|
|
|
34
34
|
## See also
|
|
35
35
|
|
|
36
|
-
[create image](/reference/images/create-image), [
|
|
36
|
+
[create image](/reference/images/create-image), [image](/reference/images/image), [show image](/reference/images/show-image), [scroll image](/reference/images/scroll-image)
|
|
37
37
|
|
|
@@ -44,4 +44,4 @@ input.onButtonPressed(Button.B, () => {
|
|
|
44
44
|
[image](/reference/images/image),
|
|
45
45
|
[create image](/reference/images/create-image),
|
|
46
46
|
[create big image](/reference/images/create-big-image),
|
|
47
|
-
[scroll image](/reference/images/scroll-image)
|
|
47
|
+
[scroll image](/reference/images/scroll-image)
|
|
@@ -52,5 +52,4 @@ for (let i = 0; i < img2.width() / 5; i++) {
|
|
|
52
52
|
|
|
53
53
|
## See also
|
|
54
54
|
|
|
55
|
-
[show image](/reference/images/show-image), [image](/reference/images/image), [create image](/reference/images/create-image), [scroll image](/reference/images/scroll-image)
|
|
56
|
-
|
|
55
|
+
[show image](/reference/images/show-image), [image](/reference/images/image), [create image](/reference/images/create-image), [scroll image](/reference/images/scroll-image)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# set Audio Pin Enabled
|
|
2
|
+
|
|
3
|
+
Enable a pin on the edge connector to output audio.
|
|
4
|
+
|
|
5
|
+
```sig
|
|
6
|
+
pins.setAudioPinEnabled(false)
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
You can enable the @boardname@ to output audio to a pin on the edge connector.
|
|
10
|
+
|
|
11
|
+
### ~ hint
|
|
12
|
+
|
|
13
|
+
#### micro:bit V2 speaker
|
|
14
|
+
|
|
15
|
+
With the [micro:bit V2](/device/v2) hardware, the built-in speaker will play (mirror) the same tones and music sent to the audio pin.
|
|
16
|
+
|
|
17
|
+
### ~
|
|
18
|
+
|
|
19
|
+
## Parameters
|
|
20
|
+
|
|
21
|
+
* **enabled**: audio is output to a pin is enabled if `true`, disabled if `false`.
|
|
22
|
+
|
|
23
|
+
## Example
|
|
24
|
+
|
|
25
|
+
Enable audio output to a pin on the edge connector and play a tone for the "A4" note at pin **P0** for 1 second.
|
|
26
|
+
|
|
27
|
+
```blocks
|
|
28
|
+
pins.setAudioPinEnabled(false)
|
|
29
|
+
pins.setAudioPin(AnalogPin.P0)
|
|
30
|
+
let frequency = 440
|
|
31
|
+
let duration = 1000
|
|
32
|
+
pins.analogPitch(frequency, duration)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## See also
|
|
36
|
+
|
|
37
|
+
[@boardname@ pins](/device/pins), [set audio pin](/reference/pins/set-audio-pin),
|
|
38
|
+
[analog set pitch pin](/reference/pins/analog-set-pitch-pin)
|
|
@@ -31,4 +31,5 @@ pins.analogPitch(frequency, duration)
|
|
|
31
31
|
|
|
32
32
|
## See also
|
|
33
33
|
|
|
34
|
-
[@boardname@ pins](/device/pins), [
|
|
34
|
+
[@boardname@ pins](/device/pins), [set audio pin enabled](/reference/pins/set-audio-pin-enabled),
|
|
35
|
+
[analog set pitch pin](/reference/pins/analog-set-pitch-pin)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pxt-microbit",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.14",
|
|
4
4
|
"description": "micro:bit target for Microsoft MakeCode (PXT)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"JavaScript",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"typescript": "4.8.3"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"pxt-common-packages": "12.0.
|
|
49
|
-
"pxt-core": "10.
|
|
48
|
+
"pxt-common-packages": "12.0.3",
|
|
49
|
+
"pxt-core": "10.2.3"
|
|
50
50
|
}
|
|
51
51
|
}
|
package/pxtarget.json
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"libs/settings",
|
|
17
17
|
"libs/flashlog",
|
|
18
18
|
"libs/datalogger",
|
|
19
|
+
"libs/fonts",
|
|
19
20
|
"libs/color",
|
|
20
21
|
"libs/audio-recording"
|
|
21
22
|
],
|
|
@@ -197,7 +198,7 @@
|
|
|
197
198
|
"codalTarget": {
|
|
198
199
|
"name": "codal-microbit-v2",
|
|
199
200
|
"url": "https://github.com/lancaster-university/codal-microbit-v2",
|
|
200
|
-
"branch": "v0.2.
|
|
201
|
+
"branch": "v0.2.67",
|
|
201
202
|
"type": "git"
|
|
202
203
|
},
|
|
203
204
|
"codalBinary": "MICROBIT",
|
package/targetconfig.json
CHANGED
|
@@ -462,7 +462,8 @@
|
|
|
462
462
|
"eb8ga/pxt-roversa-2": { "tags": [ "Robotics" ] },
|
|
463
463
|
"roborisen/gcube": { "tags": [ "Robotics" ] },
|
|
464
464
|
"kittenbot/pxt-tabbyrobot": { "tags": [ "Robotics" ] },
|
|
465
|
-
"pythom1234/pxt-oled": { "tags": [ "Lights and Display" ] }
|
|
465
|
+
"pythom1234/pxt-oled": { "tags": [ "Lights and Display" ] },
|
|
466
|
+
"softsmyth/lectrify-b4k": { "tags": [ "Robotics" ] }
|
|
466
467
|
},
|
|
467
468
|
"upgrades": {
|
|
468
469
|
"tinkertanker/pxt-iot-environment-kit": "min:v4.2.1",
|