pxt-microbit 7.0.14 → 7.0.16
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/editor.js +1 -1
- package/built/hexcache/{68c1d66616cdc9b29dab3af0dee93deac852344f969783fe2f39c9758791337a.hex → ed1952fd1d4c3257079d866091afb2bc4c6e99c65c80a55766953c8b2e7e9250.hex} +2 -2
- package/built/hexcache/{d7311504e3fadadd391f7e3b175d0bf532c9352419f404676608d2417c615cbc.hex → fbc8089808f65a1799837e03ee481088a737e25550deb72aa4dfbf7f154bdeab.hex} +3 -3
- package/built/target.js +1 -1
- package/built/target.json +1 -1
- package/built/targetlight.json +1 -1
- package/built/web/blockly.css +1 -1
- package/built/web/rtlblockly.css +1 -1
- package/built/web/rtlsemantic.css +1 -1
- package/built/web/semantic.css +1 -1
- package/docs/extensions/extension-gallery.md +1 -1
- package/docs/projects/soil-moisture/code.md +3 -2
- package/docs/projects/soil-moisture/connect.md +4 -3
- package/docs/reference/input/logo-is-pressed.md +2 -2
- package/docs/reference/music/string-playable.md +40 -0
- package/docs/reference/music/tone-playable.md +29 -0
- package/docs/types/playable.md +51 -0
- package/package.json +2 -2
- package/targetconfig.json +2 -38
- /package/built/hexcache/{0732e6383c21bfe20c40a8e9fe3784db8f5d85289bc7496a4366a5dce01f197c.hex → 9be45665f3abe402bef9a9bd8ed0ef1e4ecd9b578792c6f0d5d42d4f03d63ab4.hex} +0 -0
- /package/built/hexcache/{2f49babe14d51d847bde5c10754a0acb03db2bb140b9e84b3be886621d6ecc29.hex → ab613458a27c70d929c05304c823bf0de9c378d461db7e1ddaebcd155e73752c.hex} +0 -0
|
@@ -359,7 +359,7 @@ Many extensions are available to work with interface kits, add-on hardware, or o
|
|
|
359
359
|
"cardType": "package"
|
|
360
360
|
}, {
|
|
361
361
|
"name": "WiFi:Bit",
|
|
362
|
-
"url":"/pkg/
|
|
362
|
+
"url":"/pkg/SolderedElectronics/pxt-wifi",
|
|
363
363
|
"cardType": "package"
|
|
364
364
|
}, {
|
|
365
365
|
"name": "ESP8266 and ThingSpeak",
|
|
@@ -78,9 +78,10 @@ This saves electricity and also avoids corrosion of the probes.
|
|
|
78
78
|
led.setBrightness(64)
|
|
79
79
|
let reading = 0
|
|
80
80
|
basic.forever(() => {
|
|
81
|
-
pins.
|
|
81
|
+
pins.digitalWritePin(DigitalPin.P1, 1)
|
|
82
|
+
basic.pause(1)
|
|
82
83
|
reading = pins.analogReadPin(AnalogPin.P0)
|
|
83
|
-
pins.
|
|
84
|
+
pins.digitalWritePin(DigitalPin.P1, 0)
|
|
84
85
|
led.plotBarGraph(
|
|
85
86
|
reading,
|
|
86
87
|
1023
|
|
@@ -14,10 +14,11 @@ radio.setGroup(4)
|
|
|
14
14
|
led.setBrightness(64)
|
|
15
15
|
let reading = 0
|
|
16
16
|
basic.forever(() => {
|
|
17
|
-
pins.
|
|
17
|
+
pins.digitalWritePin(DigitalPin.P1, 1)
|
|
18
|
+
basic.pause(1)
|
|
18
19
|
reading = pins.analogReadPin(AnalogPin.P0)
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
pins.digitalWritePin(DigitalPin.P1, 0)
|
|
21
|
+
radio.sendNumber(reading / 4)
|
|
21
22
|
led.plotBarGraph(
|
|
22
23
|
reading,
|
|
23
24
|
1023
|
|
@@ -38,5 +38,5 @@ basic.forever(function () {
|
|
|
38
38
|
|
|
39
39
|
[micro:bit V2](/device/v2),
|
|
40
40
|
[on logo event](/reference/input/on-logo-event),
|
|
41
|
-
[pin is pressed](/
|
|
42
|
-
[touch set mode](/reference/pins/touch-set-mode)
|
|
41
|
+
[pin is pressed](/reference/input/pin-is-pressed),
|
|
42
|
+
[touch set mode](/reference/pins/touch-set-mode)
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# string Playable
|
|
2
|
+
|
|
3
|
+
Created a short melody of notes composed in a string.
|
|
4
|
+
|
|
5
|
+
```sig
|
|
6
|
+
music.stringPlayable("D F E A E A C B ", 120)
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
The **melody** is short series of notes composed in a string. The melody is played at a rate set by the **tempo** value you give. The melody string contains a sequence of notes formatted like this:
|
|
10
|
+
|
|
11
|
+
``"E B C5 A B G A F "``
|
|
12
|
+
|
|
13
|
+
The melody is shown in the ``||music:melody||`` block as note symbols which also appear in the Melody Editor.
|
|
14
|
+
|
|
15
|
+
```block
|
|
16
|
+
music.stringPlayable("E F G F E G B C5 ", 120)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The melodies are most often created in the Melody Editor from the block so that valid notes are chosen and the correct melody length is set.
|
|
20
|
+
|
|
21
|
+
## Parameters
|
|
22
|
+
|
|
23
|
+
* **melody**: a [string](/types/string) which contains the notes of the melody.
|
|
24
|
+
* **tempo**: a [number](/types/number) which is the rate to play the melody at in beats per minute.
|
|
25
|
+
|
|
26
|
+
## Returns
|
|
27
|
+
|
|
28
|
+
* a [playable](/types/playable) object that contains the **melody** and **tempo**.
|
|
29
|
+
|
|
30
|
+
## Example
|
|
31
|
+
|
|
32
|
+
Play the ``Mystery`` melody continuously.
|
|
33
|
+
|
|
34
|
+
```blocks
|
|
35
|
+
music.play(music.stringPlayable("E F G F E G B C5 ", 120), music.PlaybackMode.LoopingInBackground)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## See also
|
|
39
|
+
|
|
40
|
+
[tone playable](/reference/music/tone-playable)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# tone Playable
|
|
2
|
+
|
|
3
|
+
Create a musical tone that will play for some amount of time.
|
|
4
|
+
|
|
5
|
+
```sig
|
|
6
|
+
music.tonePlayable(262, music.beat(BeatFraction.Whole))
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Parameters
|
|
10
|
+
|
|
11
|
+
* **note**: is the note frequency as a [number](/types/number) of [Hertz](https://wikipedia.org/wiki/Hertz) (how high or low the tone is, also known as _pitch_). If **note** is less or equal to zero, no sound is played.
|
|
12
|
+
* **duration**: is the [number](/types/number) of milliseconds (one-thousandth of a second) that the tone lasts for. If **duration** is negative or zero, the sound will play continuously.
|
|
13
|
+
|
|
14
|
+
## Returns
|
|
15
|
+
|
|
16
|
+
* a [playable](/types/playable) object that contains the tone.
|
|
17
|
+
|
|
18
|
+
## Example
|
|
19
|
+
|
|
20
|
+
Store the musical note 'C' in the variable `note` and play that note for 1000 milliseconds (one second).
|
|
21
|
+
|
|
22
|
+
```blocks
|
|
23
|
+
let note = music.noteFrequency(Note.C);
|
|
24
|
+
music.play(music.tonePlayable(note, music.beat(BeatFraction.Whole)), music.PlaybackMode.UntilDone)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## See also
|
|
28
|
+
|
|
29
|
+
[string playable](/reference/music/string-playable)
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# playable
|
|
2
|
+
|
|
3
|
+
The **playable** data object provides a common format to play tones, melodies, and songs. Each of these music sources are created in different ways but are transformed into playable objects so that a single playback method is used to [play](/refernece/music/play) them.
|
|
4
|
+
|
|
5
|
+
## Music sources for playable objects
|
|
6
|
+
|
|
7
|
+
The blocks used to create playable music sources are the following:
|
|
8
|
+
|
|
9
|
+
### Tone
|
|
10
|
+
|
|
11
|
+
A tone is a musical note, or a sound frequency, and a duration. The duration is often set as the length of a `beat`.
|
|
12
|
+
|
|
13
|
+
```block
|
|
14
|
+
music.tonePlayable(262, music.beat(BeatFraction.Whole))
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Melody
|
|
18
|
+
|
|
19
|
+
Melodies are a series of notes and a tempo to play them at.
|
|
20
|
+
|
|
21
|
+
```block
|
|
22
|
+
music.stringPlayable("D F E A E A C B ", 120)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Play the music
|
|
26
|
+
|
|
27
|
+
In your programs, you can simply use the ``||music:play||`` blocks for each playable object. Like this one for tone:
|
|
28
|
+
|
|
29
|
+
```block
|
|
30
|
+
music.play(music.tonePlayable(262, music.beat(BeatFraction.Whole)), music.PlaybackMode.UntilDone)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Example
|
|
34
|
+
|
|
35
|
+
Put 2 different playable music sources in an array. Play one after the other.
|
|
36
|
+
|
|
37
|
+
```blocks
|
|
38
|
+
let playables = [
|
|
39
|
+
music.tonePlayable(262, music.beat(BeatFraction.Whole)),
|
|
40
|
+
music.stringPlayable("D F E A E A C B ", 120)
|
|
41
|
+
]
|
|
42
|
+
for (let someMusic of playables) {
|
|
43
|
+
music.play(someMusic, music.PlaybackMode.UntilDone)
|
|
44
|
+
basic.pause(500)
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## See also
|
|
49
|
+
|
|
50
|
+
[play](/reference/music/play), [tone playable](/reference/music/tone-playable),
|
|
51
|
+
[string playable](/reference/music/string-playable)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pxt-microbit",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.16",
|
|
4
4
|
"description": "micro:bit target for Microsoft MakeCode (PXT)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"JavaScript",
|
|
@@ -46,6 +46,6 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"pxt-common-packages": "12.0.3",
|
|
49
|
-
"pxt-core": "10.2.
|
|
49
|
+
"pxt-core": "10.2.5"
|
|
50
50
|
}
|
|
51
51
|
}
|
package/targetconfig.json
CHANGED
|
@@ -92,8 +92,7 @@
|
|
|
92
92
|
},
|
|
93
93
|
"chevyng/pxt-ucl-junkrobot": { "tags": [ "Robotics" ] },
|
|
94
94
|
"sparkfun/pxt-gamer-bit": {
|
|
95
|
-
"tags": [ "Gaming" ]
|
|
96
|
-
"upgrades": [ "dv:mbcodal" ]
|
|
95
|
+
"tags": [ "Gaming" ]
|
|
97
96
|
},
|
|
98
97
|
"sparkfun/pxt-moto-bit": { "tags": [ "Robotics" ] },
|
|
99
98
|
"sparkfun/pxt-weather-bit": { "tags": [ "Science" ] },
|
|
@@ -205,7 +204,7 @@
|
|
|
205
204
|
"alankrantas/pxt-dht11_dht22": { "tags": [ "Science" ] },
|
|
206
205
|
"freenove/makecode-extension-rover": { "tags": [ "Robotics" ] },
|
|
207
206
|
"letstalkscience/pxt-cozir": { "tags": [ "Science" ] },
|
|
208
|
-
"
|
|
207
|
+
"solderedelectronics/pxt-wifi": { "tags": [ "Networking" ] },
|
|
209
208
|
"monkmakes/pxt-sensor": { "tags": [ "Science" ] },
|
|
210
209
|
"beyond-coding-tw/pxt-nexusbot": { "tags": [ "Robotics" ] },
|
|
211
210
|
"elecfreaks/pxt-cutebot": {
|
|
@@ -465,41 +464,6 @@
|
|
|
465
464
|
"pythom1234/pxt-oled": { "tags": [ "Lights and Display" ] },
|
|
466
465
|
"softsmyth/lectrify-b4k": { "tags": [ "Robotics" ] }
|
|
467
466
|
},
|
|
468
|
-
"upgrades": {
|
|
469
|
-
"tinkertanker/pxt-iot-environment-kit": "min:v4.2.1",
|
|
470
|
-
"microsoft/pxt-bluetooth-midi": "dv:mbcodal",
|
|
471
|
-
"laboratoryforplayfulcomputation/pxt-blockytalkyble": "dv:mbcodal",
|
|
472
|
-
"microsoft/pxt-bluetooth-temperature-sensor": "dv:mbcodal",
|
|
473
|
-
"minodekit/pxt-minode": "dv:mbcodal",
|
|
474
|
-
"sparkfun/pxt-gamer-bit": "dv:mbcodal",
|
|
475
|
-
"microsoft/pxt-bluetooth-max6675": "dv:mbcodal",
|
|
476
|
-
"pimoroni/pxt-scrollbit": "min:v0.0.7",
|
|
477
|
-
"pauldfoster/pxt-microbit-gy521": "dv:mbcodal",
|
|
478
|
-
"pizayanz/pxt-linebeacon": "min:v0.0.14",
|
|
479
|
-
"sparkfun/pxt-gator-environment": "dv:mbcodal",
|
|
480
|
-
"muselab/pxt-wifi-shield": "min:v1.8.82",
|
|
481
|
-
"tinkertanker/pxt-alphanumeric-ht16k33": "min:v1.1.0",
|
|
482
|
-
"tinkertanker/microdriver_sht2x": "min:v1.0.0",
|
|
483
|
-
"alsrobot-microbit-makecode-packages/cruisebit": "dv:mbcodal",
|
|
484
|
-
"tinkertanker/udriver_pca9585": "dv:mbcodal",
|
|
485
|
-
"dfrobot/pxt-dfrobot-naturalscience": "dv:mbcodal",
|
|
486
|
-
"kitronikltd/pxt-kitronik-zip-tile": "min:v0.1.0",
|
|
487
|
-
"4tronix/bitcommander": "min:1.1.1",
|
|
488
|
-
"tinkertanker/pxt-rotary-encoder-ky040": "min:v1.2.1",
|
|
489
|
-
"KitronikLtd/pxt-kitronik-zip-64": "min:v0.1.0",
|
|
490
|
-
"KitronikLtd/pxt-kitronik-game-controller": "min:v0.0.2",
|
|
491
|
-
"Tinkertanker/pxt-tinkercademy-microbot": "dv:mbcodal",
|
|
492
|
-
"Tinkertanker/pxt-range-vl53l0x": "min:v1.0.1",
|
|
493
|
-
"Imagimaker/pxt-imagimaker": "dv:mbcodal",
|
|
494
|
-
"PiSupply/pxt-oled-ssd1306": "dv:mbcodal",
|
|
495
|
-
"sparkfun/pxt-gator-particle": "dv:mbcodal",
|
|
496
|
-
"sparkfun/pxt-gator-microphone": "min:v1.0.21",
|
|
497
|
-
"rebeccaclavier/pxt-bmp280": "dv:mbcodal",
|
|
498
|
-
"mu-opensource/pxt-muvision": "min:v1.2.28",
|
|
499
|
-
"elecfreaks/pxt-PlanetX": "min:v0.13.1",
|
|
500
|
-
"bsiever/microbit-pxt-timeanddate": "min:v2.0.11",
|
|
501
|
-
"microsoft/pxt-jacdac": "min:v0.10.40"
|
|
502
|
-
},
|
|
503
467
|
"approvedEditorExtensionUrls": [
|
|
504
468
|
"https://microsoft.github.io/ml4f/",
|
|
505
469
|
"https://microsoft.github.io/jacdac-docs/tools/makecode-editor-extension"
|
|
File without changes
|