pxt-common-packages 13.2.2 → 13.2.4

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.
Files changed (51) hide show
  1. package/built/common-sim.js +18 -6
  2. package/libs/base/docs/reference/control/device-long-serial-number.md +26 -0
  3. package/libs/base/docs/reference/control/device-serial-number.md +1 -0
  4. package/libs/base/docs/reference/math/constrain.md +36 -0
  5. package/libs/base/docs/reference/math/map.md +36 -0
  6. package/libs/color-coded-tilemap/docs/reference/color-coded-tilemap/tile-hit-from.md +81 -0
  7. package/libs/color-coded-tilemap/tilemap.ts +2 -2
  8. package/libs/controller/built/debug/binary.js +3 -3
  9. package/libs/controller---none/built/debug/binary.js +3 -3
  10. package/libs/core/docs/reference/control/device-dal-version.md +25 -0
  11. package/libs/core/docs/reference/control/millis.md +25 -0
  12. package/libs/core/docs/reference/control/pause-until.md +31 -0
  13. package/libs/core/docs/reference/control/raise-event.md +61 -0
  14. package/libs/core/docs/reference/control/reset.md +20 -0
  15. package/libs/core/docs/reference/control/seconds.md +24 -0
  16. package/libs/core/docs/reference/control.md +17 -0
  17. package/libs/core/timer.ts +4 -0
  18. package/libs/core---esp32/dal.d.ts +2 -0
  19. package/libs/core---esp32s2/dal.d.ts +2 -0
  20. package/libs/game/built/debug/binary.js +3 -3
  21. package/libs/game/docs/reference/game/runtime.md +46 -0
  22. package/libs/light/defaultlights.ts +1 -0
  23. package/libs/light/defaultlightsoverrides.ts +3 -0
  24. package/libs/light/docs/reference/light/create-apa102-strip.md +42 -0
  25. package/libs/light/docs/reference/light/default-strip.md +32 -0
  26. package/libs/light/docs/reference/light/neopixelstrip/set-gradient.md +31 -0
  27. package/libs/light/docs/reference/light/neopixelstrip/set-length.md +30 -0
  28. package/libs/light/docs/reference/light/neopixelstrip/set-mode.md +9 -0
  29. package/libs/light/docs/reference/light/onboard-strip.md +32 -0
  30. package/libs/light/docs/reference/light/range.md +61 -0
  31. package/libs/light/docs/reference/light/set-length.md +29 -0
  32. package/libs/light/docs/reference/light/set-mode.md +28 -0
  33. package/libs/light/neopixel.ts +2 -0
  34. package/libs/mixer/sim/music.ts +18 -6
  35. package/libs/mouse/docs/reference/mouse/click.md +38 -0
  36. package/libs/multiplayer/docs/reference/multiplayer/all-players.md +34 -0
  37. package/libs/multiplayer/docs/reference/multiplayer/is-connected.md +36 -0
  38. package/libs/multiplayer/player.ts +1 -1
  39. package/libs/music/docs/reference/music/play-tone.md +8 -3
  40. package/libs/music/docs/reference/music/set-tone.md +8 -3
  41. package/libs/net-game/built/debug/binary.js +3 -3
  42. package/libs/palette/built/debug/binary.js +3 -3
  43. package/libs/power/power.ts +4 -4
  44. package/libs/radio/docs/reference/radio/received-packet.md +39 -0
  45. package/libs/sprite-scaling/built/debug/binary.js +3 -3
  46. package/libs/storyboard/built/debug/binary.js +3 -3
  47. package/libs/switch/docs/reference/input/switch-right.md +27 -0
  48. package/libs/switch/shims.d.ts +2 -1
  49. package/libs/switch/switch.cpp +1 -0
  50. package/libs/touch/docs/reference/input/touch/threshold.md +33 -0
  51. package/package.json +1 -1
@@ -0,0 +1,39 @@
1
+ # received Packet
2
+
3
+ Get a property for the last radio packet received
4
+
5
+ ```sig
6
+ radio.receivedPacket(RadioPacketProperty.Time)
7
+ ```
8
+
9
+ Some information about the last packet received is available such as the time it was received, the packet serial number, or the signal strength when received.
10
+
11
+ ## Parameters
12
+
13
+ * **type**: the type of property to return for the received packet:
14
+
15
+ > `time`: the time when the packed was received
16
+ > `serial number`: the serial number of the packet
17
+ > `signal strength`: the signal strength at the time the packet was received
18
+
19
+ ## Simulator
20
+
21
+ This function only works on the @boardname@, not in browsers.
22
+
23
+ ## Example
24
+
25
+ Get the signal strength of the last received packet.
26
+
27
+ ```blocks
28
+ let ss = radio.receivedPacket(RadioPacketProperty.SignalStrength)
29
+ ```
30
+
31
+ ## See also
32
+
33
+ [on received number](/reference/radio/on-received-number),
34
+ [on received string](/reference/radio/on-received-string),
35
+ [on received value](/reference/radio/on-received-value)
36
+
37
+ ```package
38
+ radio
39
+ ```
@@ -7524,7 +7524,7 @@ switch (step) {
7524
7524
  return leave(s, r0)
7525
7525
  default: oops()
7526
7526
  } } }
7527
- power_checkDeepSleep__P199675.info = {"start":1087,"length":298,"line":36,"column":4,"endLine":46,"endColumn":5,"fileName":"pxt_modules/power/power.ts","functionName":"checkDeepSleep","argumentNames":[]}
7527
+ power_checkDeepSleep__P199675.info = {"start":1084,"length":298,"line":36,"column":4,"endLine":46,"endColumn":5,"fileName":"pxt_modules/power/power.ts","functionName":"checkDeepSleep","argumentNames":[]}
7528
7528
 
7529
7529
  function power_checkDeepSleep__P199675_mk(s) {
7530
7530
  checkStack(s.depth);
@@ -7587,7 +7587,7 @@ switch (step) {
7587
7587
  return leave(s, r0)
7588
7588
  default: oops()
7589
7589
  } } }
7590
- power_init__P199677.info = {"start":1610,"length":376,"line":57,"column":4,"endLine":66,"endColumn":5,"fileName":"pxt_modules/power/power.ts","functionName":"init","argumentNames":[]}
7590
+ power_init__P199677.info = {"start":1606,"length":376,"line":57,"column":4,"endLine":66,"endColumn":5,"fileName":"pxt_modules/power/power.ts","functionName":"init","argumentNames":[]}
7591
7591
 
7592
7592
  function power_init__P199677_mk(s) {
7593
7593
  checkStack(s.depth);
@@ -11999,7 +11999,7 @@ switch (step) {
11999
11999
  return leave(s, r0)
12000
12000
  default: oops()
12001
12001
  } } }
12002
- power_poke__P199674.info = {"start":795,"length":81,"line":26,"column":4,"endLine":29,"endColumn":5,"fileName":"pxt_modules/power/power.ts","functionName":"poke","argumentNames":[]}
12002
+ power_poke__P199674.info = {"start":793,"length":81,"line":26,"column":4,"endLine":29,"endColumn":5,"fileName":"pxt_modules/power/power.ts","functionName":"poke","argumentNames":[]}
12003
12003
 
12004
12004
  function power_poke__P199674_mk(s) {
12005
12005
  checkStack(s.depth);
@@ -7524,7 +7524,7 @@ switch (step) {
7524
7524
  return leave(s, r0)
7525
7525
  default: oops()
7526
7526
  } } }
7527
- power_checkDeepSleep__P159791.info = {"start":1087,"length":298,"line":36,"column":4,"endLine":46,"endColumn":5,"fileName":"pxt_modules/power/power.ts","functionName":"checkDeepSleep","argumentNames":[]}
7527
+ power_checkDeepSleep__P159791.info = {"start":1084,"length":298,"line":36,"column":4,"endLine":46,"endColumn":5,"fileName":"pxt_modules/power/power.ts","functionName":"checkDeepSleep","argumentNames":[]}
7528
7528
 
7529
7529
  function power_checkDeepSleep__P159791_mk(s) {
7530
7530
  checkStack(s.depth);
@@ -7587,7 +7587,7 @@ switch (step) {
7587
7587
  return leave(s, r0)
7588
7588
  default: oops()
7589
7589
  } } }
7590
- power_init__P159793.info = {"start":1610,"length":376,"line":57,"column":4,"endLine":66,"endColumn":5,"fileName":"pxt_modules/power/power.ts","functionName":"init","argumentNames":[]}
7590
+ power_init__P159793.info = {"start":1606,"length":376,"line":57,"column":4,"endLine":66,"endColumn":5,"fileName":"pxt_modules/power/power.ts","functionName":"init","argumentNames":[]}
7591
7591
 
7592
7592
  function power_init__P159793_mk(s) {
7593
7593
  checkStack(s.depth);
@@ -11999,7 +11999,7 @@ switch (step) {
11999
11999
  return leave(s, r0)
12000
12000
  default: oops()
12001
12001
  } } }
12002
- power_poke__P159790.info = {"start":795,"length":81,"line":26,"column":4,"endLine":29,"endColumn":5,"fileName":"pxt_modules/power/power.ts","functionName":"poke","argumentNames":[]}
12002
+ power_poke__P159790.info = {"start":793,"length":81,"line":26,"column":4,"endLine":29,"endColumn":5,"fileName":"pxt_modules/power/power.ts","functionName":"poke","argumentNames":[]}
12003
12003
 
12004
12004
  function power_poke__P159790_mk(s) {
12005
12005
  checkStack(s.depth);
@@ -0,0 +1,27 @@
1
+ # switch Right
2
+
3
+ Check if a switch is positioned to the right.
4
+
5
+ ```sig
6
+ input.switchRight( )
7
+
8
+ ```
9
+ ## Returns
10
+
11
+ * a [boolean](/types/boolean) value that is `true` if the switch is in the **right** position or `false` if it is in the **left** position.
12
+
13
+ ## Example #example
14
+
15
+ Check if a switch is in the `right` position.
16
+
17
+ ```blocks
18
+ let isRight = input.switchRight()
19
+ ```
20
+
21
+ ## See also #seealso
22
+
23
+ [on event](/reference/input/on-switch-moved)
24
+
25
+ ```package
26
+ input
27
+ ```
@@ -16,7 +16,8 @@ declare namespace input {
16
16
  */
17
17
  //% blockId=device_switch_direction block="switch right"
18
18
  //% parts="switch"
19
- //% group="Switch" weight=10 blockGap=8 shim=input::switchRight
19
+ //% group="Switch" weight=10 blockGap=8
20
+ //% help=input/switch-right shim=input::switchRight
20
21
  function switchRight(): boolean;
21
22
  }
22
23
 
@@ -43,6 +43,7 @@ void onSwitchMoved(SwitchDirection direction, Action handler) {
43
43
  //% blockId=device_switch_direction block="switch right"
44
44
  //% parts="switch"
45
45
  //% group="Switch" weight=10 blockGap=8
46
+ //% help=input/switch-right
46
47
  bool switchRight() {
47
48
  auto slide = getWSwitch();
48
49
  return slide->slideSwitch.isPressed();
@@ -0,0 +1,33 @@
1
+ # threshold
2
+
3
+ Get the current threshold set for a touch pin.
4
+
5
+ ```sig
6
+ input.touchA1.threshold()
7
+ ```
8
+
9
+ Pins (or pads) on a board used to detect a touch are measured to see how much electrical charge is on them. This measurement happens over a short period of time while a charge builds up when you touch it. To control the amount of charge it takes for the touch circuit to say that a touch happen, you set the touch threshold.
10
+
11
+ Setting a higher threshold value makes it take longer for a touch event to happen. If you want a touch event to require you to stay on the pin for a while, then set the value to something high. Quick taps on the pin will signal a touch with a lower threshold value.
12
+
13
+ ## Returns
14
+
15
+ * a [number](/types/number) that is the currently set threshold (charge amount) needed to detect that a pin was touched. This is a value between `0` and `1023`.
16
+
17
+ ## Example #example
18
+
19
+ Set the touch threshold to `1000` if it's set to a lower value.
20
+
21
+ ```blocks
22
+ if (input.touchA1.threshold()) {
23
+ input.touchA1.setThreshold(1000)
24
+ }
25
+ ```
26
+
27
+ ## See also #seealso
28
+
29
+ [set threshold](/reference/input/touch/set-threshold)
30
+
31
+ ```package
32
+ touch
33
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pxt-common-packages",
3
- "version": "13.2.2",
3
+ "version": "13.2.4",
4
4
  "description": "Microsoft MakeCode (PXT) common packages",
5
5
  "keywords": [
6
6
  "MakeCode",