pxt-microbit 8.1.1 → 8.1.3

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,131 @@
1
+ # Constant
2
+
3
+ A common mathematical constant value.
4
+
5
+ ```sig
6
+ Math._constant(Math.PI)
7
+ ```
8
+
9
+ There are several constant values that are important in calculations for science and engineering. The ``||math.constant||`` block provides several that you can use in your mathematical formulas and expressions.
10
+
11
+ ## π
12
+
13
+ The value of Pi (π) which is the ratio of a circle's circumference to its diameter.
14
+
15
+ ```block
16
+ Math._constant(Math.PI)
17
+ ```
18
+
19
+ ### Example
20
+
21
+ Get the area of a circle with a radius of `4`.
22
+
23
+ ```block
24
+ let circle_area = Math.PI * 4**2
25
+ ```
26
+
27
+ ## e
28
+
29
+ Euler's number (e) which is the base of the natural logarithm and the exponential function.
30
+
31
+ ```block
32
+ Math._constant(Math.E)
33
+ ```
34
+
35
+ ### Example
36
+
37
+ Find the half-life, in years, of radioactive decay for Carbon-14.
38
+
39
+ ```block
40
+ let time = 0
41
+ let decay = 0.000121
42
+ let carbon14 = 1
43
+ while (carbon14 > 0.5) {
44
+ carbon14 = Math.E ** (-1 * decay * time)
45
+ time += 1
46
+ }
47
+ ```
48
+
49
+ ## ln(2)
50
+
51
+ Natural log of 2.
52
+
53
+ ```block
54
+ Math._constant(Math.LN2)
55
+ ```
56
+
57
+ ### Example
58
+
59
+ Find out how many years will it take to double an investment using continuous compounding at 5% interest.
60
+
61
+ ```block
62
+ let years = Math.LN2 / 0.05
63
+ ```
64
+
65
+ ## ln(10)
66
+
67
+ Natural log of 10.
68
+
69
+ ```block
70
+ Math._constant(Math.LN10)
71
+ ```
72
+
73
+ ### Example
74
+
75
+ How many days will it take for bacteria in a culture to reach 10 times the start amount if they double in number each day.
76
+
77
+ ```block
78
+ let days = Math.LN10
79
+ ```
80
+
81
+ ## log₂(e)
82
+
83
+ Convert from a natural logarithm to a base-2 logarithm.
84
+
85
+ ```block
86
+ Math._constant(Math.LOG2E)
87
+ ```
88
+
89
+ The log₂(e) constant is equal to ln(e) / ln(2) which is also 1 / ln(2).
90
+
91
+ ## log₁₀(e)
92
+
93
+ Convert from a natural logarithm to a base-10 logarithm.
94
+
95
+ ```block
96
+ Math._constant(Math.LOG10E)
97
+ ```
98
+
99
+ The log₁₀(e) constant is equal to 1 / ln(10) which is also 1 / ln(10).
100
+
101
+ ## √½
102
+
103
+ The square root of one half (1/2).
104
+
105
+ ```block
106
+ Math._constant(Math.SQRT1_2)
107
+ ```
108
+
109
+ ### Example
110
+
111
+ Find the length of the sides of a square with a diagonal length of 9.
112
+
113
+ ```block
114
+ let side = 9 * Math.SQRT1_2
115
+ ```
116
+
117
+ ## √2
118
+
119
+ The square root of 2.
120
+
121
+ ```block
122
+ Math._constant(Math.SQRT2)
123
+ ```
124
+
125
+ ### Example
126
+
127
+ Find out how much shorter it is by walking across a square parking lot on a street corner than using the sidewalk on the sides. Each side of the parking lot is 50 meters.
128
+
129
+ ```block
130
+ let walk_diff = 2 * 50 - 50 * Math.SQRT2
131
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pxt-microbit",
3
- "version": "8.1.1",
3
+ "version": "8.1.3",
4
4
  "description": "micro:bit target for Microsoft MakeCode (PXT)",
5
5
  "keywords": [
6
6
  "JavaScript",
package/pxtarget.json CHANGED
@@ -427,9 +427,7 @@
427
427
  "addNewTypeScriptFile": true,
428
428
  "enabledFeatures": {
429
429
  "blocksErrorList": {},
430
- "aiErrorHelp": {
431
- "includeRegions": ["CA", "GB", "BR"]
432
- }
430
+ "aiErrorHelp": {}
433
431
  },
434
432
  "experiments": [
435
433
  "debugExtensionCode",
package/targetconfig.json CHANGED
@@ -429,7 +429,9 @@
429
429
  "forward-education/pxt-climate-action": { "tags": [ "Science" ] },
430
430
  "elecfreaks/pxt-petal": { "tags": [ "Science" ] },
431
431
  "kitronikltd/pxt-kitronik-mai-z": { "tags": [ "Robotics" ] },
432
+ "smarthon/pxt-smarthome": { "tags": [ "Networking" ] },
432
433
  "roborisen/braillebot": { "tags": [ "Robotics" ] },
434
+ "backyardbrains/pxt-spikerbit": { "tags": [ "Science" ] },
433
435
  "microsoft/pxt-simx-sample": {
434
436
  "simx": {
435
437
  "sha": "7301f5900879b85127482d79bab48f03c25690a8",
@@ -446,7 +448,7 @@
446
448
  },
447
449
  "jacdac/pxt-jacdac": {
448
450
  "simx": {
449
- "sha": "9a567f397293aa27a06eab91910838f62a100753",
451
+ "sha": "1804c0b3d2976935c476f3b6d425b554a20fa814",
450
452
  "devUrl": "https://jacdac.github.io/jacdac-docs/tools/makecode-sim/"
451
453
  }
452
454
  },
@@ -467,13 +469,15 @@
467
469
  "galleries": {
468
470
  "Tutorials": "tutorials",
469
471
  "Tutorials for the new micro:bit (V2)": "tutorials-v2",
472
+ "Games": "projects/games",
473
+ "Make it: code it Examples": "microbit-org/make-it-code-it",
474
+ "Radio Games": "projects/radio-games",
475
+ "Data Logging Examples": "microbit-org/data-logging",
470
476
  "Live Coding": {
471
477
  "url": "live-coding",
472
478
  "shuffle": "daily",
473
479
  "youTube": true
474
480
  },
475
- "Games": "projects/games",
476
- "Radio Games": "projects/radio-games",
477
481
  "Fashion": "projects/fashion",
478
482
  "Music": "projects/music",
479
483
  "Toys": "projects/toys",
@@ -481,9 +485,12 @@
481
485
  "Tools": "projects/tools",
482
486
  "Turtle": "projects/turtle",
483
487
  "Blocks to JavaScript": "courses/blocks-to-javascript",
488
+ "First Lessons with MakeCode and the micro:bit": "microbit-org/first-lessons",
489
+ "CreateAI": "microbit-org/createai",
484
490
  "Courses": "courses",
485
491
  "Jacdac": "jacdac",
486
492
  "MicroCode for the new micro:bit (V2)": "microcode",
493
+ "Introductory micro:bit Feature Videos": "microbit-org/feature-videos",
487
494
  "Behind the MakeCode Hardware": {
488
495
  "url": "behind-the-makecode-hardware",
489
496
  "youTube": true
@@ -492,6 +499,7 @@
492
499
  "url": "science-experiments",
493
500
  "youTube": true
494
501
  },
502
+ "Educator Professional Development": "microbit-org/professional-development",
495
503
  "Coding for Teachers": {
496
504
  "url": "coding-for-teachers",
497
505
  "youTube": true