pxt-microbit 7.0.35 → 7.0.36

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.
@@ -0,0 +1,51 @@
1
+ # built In Melody
2
+
3
+ Get a melody string for a built-in melody.
4
+
5
+ ```sig
6
+ music.builtInMelody(Melodies.Dadadadum)
7
+ ```
8
+
9
+ A collection of built-in melodies are available. You choose one by selecting the name of the melody.
10
+
11
+ ## Parameters
12
+
13
+ * **melody**: A melody name. The available melodies are:
14
+
15
+ >* `dadadum`
16
+ >* `entertainer`
17
+ >* `prelude`
18
+ >* `ode`
19
+ >* `nyan`
20
+ >* `ringtone`
21
+ >* `funk`
22
+ >* `blues`
23
+ >* `birthday`
24
+ >* `wedding`
25
+ >* `funeral`
26
+ >* `punchline`
27
+ >* `baddy`
28
+ >* `chase`
29
+ >* `ba ding`
30
+ >* `wawawawaa`
31
+ >* `jump up`
32
+ >* `jump down`
33
+ >* `power up`
34
+ >* `power down`
35
+
36
+ ## Returns
37
+
38
+ * a [string](/types/string) that contains the melody.
39
+
40
+ ## Example
41
+
42
+ Play the built-in melody for **blues**.
43
+
44
+ ```blocks
45
+ music.startMelody(music.builtInMelody(Melodies.Blues), MelodyOptions.Once)
46
+ ```
47
+
48
+ ## See also
49
+
50
+ [start melody](/reference/music/start-melody),
51
+ [built-in sound effect](/reference/music/builtin-sound-effect)
@@ -0,0 +1,50 @@
1
+ # built In Playable Melody
2
+
3
+ Get a playable sound object for a built-in melody.
4
+
5
+ ```sig
6
+ music.builtInPlayableMelody(Melodies.Dadadadum)
7
+ ```
8
+
9
+ A collection of built-in melodies are available as [playable](/types/playable) sound objects. You choose one by selecting the name of the melody.
10
+
11
+ ## Parameters
12
+
13
+ * **melody**: A melody name. The available melodies are:
14
+
15
+ >* `dadadum`
16
+ >* `entertainer`
17
+ >* `prelude`
18
+ >* `ode`
19
+ >* `nyan`
20
+ >* `ringtone`
21
+ >* `funk`
22
+ >* `blues`
23
+ >* `birthday`
24
+ >* `wedding`
25
+ >* `funeral`
26
+ >* `punchline`
27
+ >* `baddy`
28
+ >* `chase`
29
+ >* `ba ding`
30
+ >* `wawawawaa`
31
+ >* `jump up`
32
+ >* `jump down`
33
+ >* `power up`
34
+ >* `power down`
35
+
36
+ ## Returns
37
+
38
+ * a [playable](/types/playable) object that contains the melody.
39
+
40
+ ## Example
41
+
42
+ Play the built-in melody for **blues**.
43
+
44
+ ```blocks
45
+ music.play(music.builtInPlayableMelody(Melodies.Blues), music.PlaybackMode.InBackground)
46
+ ```
47
+
48
+ ## See also
49
+
50
+ [built-in sound effect](/reference/music/builtin-sound-effect)
@@ -0,0 +1,32 @@
1
+ # analog Pin
2
+
3
+ Get an analog pin number for a pin identifier.
4
+
5
+ ```sig
6
+ pins._analogPin(AnalogPin.P0)
7
+ ```
8
+
9
+ ## Parameters
10
+
11
+ * **pin**: a pin identifier for an analog pin (`P0` through `P20`).
12
+
13
+ ## Returns
14
+
15
+ * a pin [number](/types/number) for the pin identifier.
16
+
17
+ ## Example
18
+
19
+ Set an analog pin variable for `P1`, read pin `P1`, and show the input value on the LED screen.
20
+
21
+ ```blocks
22
+ let myPin = AnalogPin.P1
23
+ basic.forever(function() {
24
+ let value = pins.analogReadPin(myPin)
25
+ basic.showNumber(value)
26
+ })
27
+ ```
28
+
29
+ ## See also
30
+
31
+ [analog read pin](/reference/pins/analog-read-pin),
32
+ [analog write pin](/reference/pins/analog-write-pin)
@@ -0,0 +1,43 @@
1
+ # digital Pin
2
+
3
+ Get an digital pin number for a pin identifier.
4
+
5
+ ```sig
6
+ pins._digitalPin(DigitalPin.P3)
7
+ ```
8
+
9
+ ## Parameters
10
+
11
+ * **pin**: a pin identifier for an digital pin (`P0` through `P20`).
12
+
13
+ ## Returns
14
+
15
+ * a pin [number](/types/number) for the pin identifier.
16
+
17
+ ## Example: football score keeper
18
+
19
+ This program reads pin `P0` to find when a goal is scored. When `P0`
20
+ is `1`, the program makes the score bigger and plays a buzzer sound
21
+ through `P2` with ``||pins:digital write pin||``. Use pin variables
22
+ to set the read and write pin numbers.
23
+
24
+ ```blocks
25
+ let score = 0
26
+ let readPin = DigitalPin.P0
27
+ let writePin = DigitalPin.P2
28
+ basic.showNumber(score)
29
+ basic.forever(() => {
30
+ if (pins.digitalReadPin(readPin) == 1) {
31
+ score++;
32
+ pins.digitalWritePin(writePin, 1)
33
+ basic.showNumber(score)
34
+ basic.pause(1000)
35
+ pins.digitalWritePin(writePin, 0)
36
+ }
37
+ })
38
+ ```
39
+
40
+ ## See also
41
+
42
+ [digital read pin](/reference/pins/digital-read-pin),
43
+ [digital write pin](/reference/pins/digital-write-pin)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pxt-microbit",
3
- "version": "7.0.35",
3
+ "version": "7.0.36",
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.4",
49
- "pxt-core": "10.2.31"
49
+ "pxt-core": "10.2.33"
50
50
  }
51
51
  }