Skip to content

Commit 195bbb9

Browse files
authored
Merge branch 'master' into upgradeGithubRepo
2 parents 8314d47 + 531904a commit 195bbb9

File tree

96 files changed

+2176
-1713
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+2176
-1713
lines changed

docs/about.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The BBC micro:bit is packaged with sensors, radio, microphone, speaker and other
1717

1818
## ~ hint
1919

20-
**Looking to buy a micro:bit?** See the [list of resellers](https://microbit.org/resellers).
20+
**Looking to buy a micro:bit?** See the [list of official products](https://microbit.org/buy/).
2121

2222
## ~
2323

docs/ai-faq.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# MakeCode AI Features
2+
3+
## Responsible AI FAQ
4+
5+
MakeCode is introducing AI-powered features to enhance the learning and teaching experiences on the platform. These tools are designed to provide educational support while maintaining responsible AI practices.
6+
7+
### AI Features Overview
8+
9+
MakeCode now includes several AI-powered tools to support both students and educators:
10+
11+
- **Error Helper**: Helps students understand and resolve coding errors with AI-generated explanations
12+
- **Code Evaluation Tool**: Assists teachers in evaluating and providing feedback on student projects
13+
14+
### Feature-Specific FAQs
15+
16+
For detailed information about each AI feature, including their capabilities, limitations, and responsible use guidelines, please visit the specific FAQ pages:
17+
18+
#### [Error Helper AI FAQ](/errorhelper/ai-faq)
19+
Learn about the AI-powered Error Helper that walks students through exceptions in their projects.
20+
21+
#### [Code Evaluation Tool AI FAQ](/teachertool/ai-faq)
22+
Learn about the AI tool designed to help teachers evaluate and provide feedback on student programs.
23+
24+
### General AI Principles
25+
26+
All MakeCode AI features are designed with the following principles:
27+
28+
- **Educational Focus**: Tools are specifically designed for learning and teaching scenarios
29+
- **Transparency**: Clear information about what each tool does and its limitations
30+
- **Safety**: Built-in safeguards and content filtering appropriate for educational environments

docs/beta-ref.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"appref": "v"
2+
"appref": "v8.0"
33
}

docs/blocks/loops.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ loops.everyInterval(500, function () {})
1212
[while](/blocks/loops/while),
1313
[repeat](/blocks/loops/repeat),
1414
[for of](/blocks/loops/for-of),
15-
[every](/reference/loops/every)
15+
[every](/reference/loops/every-interval)

docs/courses/csintro.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,15 @@ Each of the 12 lessons is structured in this format:
4848
### Lessons
4949

5050
1. [Making](/courses/csintro/making)
51-
2. [Algorithms](/courses/csintro/algorithms)
52-
3. [Variables](/courses/csintro/variables)
51+
2. [Algorithms](/courses/csintro/algorithms)
52+
3. [Variables](/courses/csintro/variables)
5353
4. [Conditionals](/courses/csintro/conditionals)
54-
5. [Iteration](/courses/csintro/iteration)
54+
5. [Iteration](/courses/csintro/iteration)
5555
6. [Review/Mini-Project](/courses/csintro/miniproject)
5656
7. [Coordinate grid system](/courses/csintro/coordinates)
5757
8. [Booleans](/courses/csintro/booleans)
5858
9. [Bits, bytes, and binary](/courses/csintro/binary)
5959
10. [Radio](/courses/csintro/radio)
60-
11. [Arrays](/courses/csintro/arrays)
61-
12. [Independent final project](/courses/csintro/finalproject)
60+
11. [Accelerometer](/courses/csintro/accelerometer)
61+
12. [Arrays](/courses/csintro/arrays)
62+
13. [Independent final project](/courses/csintro/finalproject)

docs/courses/csintro/SUMMARY.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,14 @@
107107
* [Project](/courses/csintro/radio/project)
108108
* [Standards](/courses/csintro/radio/standards)
109109

110+
## [Accelerometer](/courses/csintro/accelerometer)
111+
112+
* [Accelerometer](/courses/csintro/accelerometer)
113+
* [Overview](/courses/csintro/accelerometer)
114+
* [Activity](/courses/csintro/accelerometer)
115+
* [Project](/courses/csintro/accelerometer)
116+
* [Standards](/courses/csintro/accelerometer)
117+
110118
## Arrays
111119

112120
* [Arrays](/courses/csintro/arrays)

docs/courses/csintro/about.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ You can follow him on Twitter at [@dkiang](http://twitter.com/dkiang).
77

88
![Mary Kiang](/static/courses/csintro/mary-kiang-foto.png)
99

10-
Mary Kiang has been teaching for over twenty-five years at elementary, middle, and high school levels. She also developed curriculum in the Education Department of the Museum of Science in Boston. She currently teaches 6th grade Math/Science at Punahou School. Mary is a former programmer for Houghton Mifflin and Dun & Bradstreet and holds a Master’s degree in Elementary Education from Simmons College. Mary is the founder of GO Code!, an organization that supports girls and young women in exploring coding and STEM.
10+
Mary Kiang has been teaching for over twenty-five years at elementary, middle, and high school levels. She also developed curriculum in the Education Department of the Museum of Science in Boston. She currently teaches 6th grade Math/Science at Punahou School. Mary is a former programmer for Houghton Mifflin and Dun & Bradstreet and holds a Master’s degree in Elementary Education from Simmons College. Mary is the founder of GO Code!, an organization that supports girls and young women in exploring coding and STEM.

docs/courses/csintro/accelerometer.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Accelerometer
2+
3+
![Acceleration Example](/static/courses/csintro/accelerometer/highvelocitylowaccel.png)
4+
5+
This unit introduces the accelerometer functionality of the micro:bit. Even if one is unfamiliar with the word “accelerometer,” most people are aware of the function. The micro:bit accelerometer measures how the micro:bit is positioned and moving through space. The unplugged activity has the students sense their own body’s way of knowing its position and movement through space. The birdhouse activity leads the students to use the micro:bit’s accelerometer capabilities to create a program that reminds them to stand up every so often. This unit’s project is to create a “multi-tool” that uses a combination of different sensors using the accelerometer to solve a problem or serve a purpose.
6+
7+
8+
## Lesson objectives
9+
10+
You will...
11+
12+
* Understand how to use the Accelerometer blocks to sense the micro:bit’s position and movement in three-dimensional space
13+
* Understand the x, y, z axes and measurement of gravitational force
14+
* Apply the above knowledge and skills to design a unique program using the accelerometer
15+
16+
## Lesson structure
17+
18+
* Introduction: Understanding the Accelerometer
19+
* micro:bit Activity: Marco Polo & Morse Code
20+
* Project: Radio
21+
* Assessment: Rubric
22+
* Standards: Listed
23+
24+
## Lesson plan
25+
26+
1. [**Overview**: Understanding the Accelerometer](/courses/csintro/accelerometer/overview)
27+
2. [**Activity**: Stand for Health](/courses/csintro/accelerometer/activity)
28+
3. [**Project**: Accelerometer project](/courses/csintro/accelerometer/project)
29+
30+
## Related standards
31+
32+
[Targeted CSTA standards](/courses/csintro/accelerometer/standards)
Lines changed: 267 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,267 @@
1+
# Coding Activity: Stand for Health!
2+
3+
In our modern world, most of us sit for long stretches of time without ever getting up to stretch our legs. Standing up every so often is good for our physical health.
4+
5+
We will use the micro:bit’s accelerometer to create a program that will let us know if we have been sitting too long.
6+
7+
1. Inside the Variables Toolbox: Create a variable to keep track of how much time has passed since the program started.
8+
- Name the variable **TimeStarted**.
9+
- Place the newly created ‘**set TimeStarted**’ block inside the ‘**on start**’ block.
10+
- Set the value of this variable to **0 (zero)** each time the program starts.
11+
12+
```block
13+
let TimeStarted = 0
14+
```
15+
16+
2. From the Logic toolbox: Get and place an ‘**if…else**’ block inside the ‘**forever**’ block.
17+
- From the Logic toolbox: Get and place a **comparison** block into the ‘**true**’ space in the ‘**if**’ line of code.
18+
- From the Input Toolbox: Get and place the **acceleration** block into the **left side of the comparison block**.
19+
- In the **acceleration** block: Change the default value of ‘x’ to ‘z’.
20+
- Set the **comparison** block symbol to ‘**less than**’ (<).
21+
- Set the value on the **right-hand side of the comparison block** to **-700**.
22+
23+
```block
24+
basic.forever(function () {
25+
if (input.acceleration(Dimension.Z) < -700) {
26+
27+
} else {
28+
29+
}
30+
})
31+
32+
```
33+
## Check for Understanding
34+
35+
This line of code tells the micro:bit to forever check the acceleration of the micro:bit and if the value of acceleration is less than -700, do something.
36+
37+
Remember that when the micro:bit is lying flat on a surface with the screen pointing up:
38+
39+
x is 0, y is 0, z is -1023, and strength is 1023.
40+
41+
If the micro:bit is lying face up and flat, the Z value will be in this negative range. When your program is done, you can experiment with this number value, making it greater or less than the value used here to see how changing the value affects how the micro:bit reacts.
42+
43+
3. From the Basic Toolbox: Get two ‘show leds’ blocks.
44+
- Place one ‘show leds’ block under the ‘if’ line of code.
45+
- Make an image of a chair in this block to indicate sitting. (Feel free to change it to an image that works for you.)
46+
- Place the other ‘show leds’ block under the ‘else’ line of code.
47+
- Make an image of a person standing in this block. (Feel free to change it to an image that works for you.)
48+
49+
```block
50+
basic.forever(function () {
51+
if (input.acceleration(Dimension.Z) < -700) {
52+
basic.showLeds(`
53+
# . . . .
54+
# . . . .
55+
# # # # .
56+
# . . # .
57+
# . . # .
58+
`)
59+
} else {
60+
basic.showLeds(`
61+
. . # . .
62+
# # # # #
63+
. . # . .
64+
. # . # .
65+
. # . # .
66+
`)
67+
}
68+
})
69+
70+
```
71+
72+
## Check for Understanding
73+
74+
Now our micro:bit will show the chair image if the micro:bit is lying face up and flat, and a person standing image if the position of the micro:bit changes from lying flat and face up.
75+
76+
Now, we will add in the time variable to keep track of how long we have been sitting.
77+
78+
4. From the Logic toolbox: Get and place an ‘**if**’ block directly under the first ‘**show leds**’ block.
79+
- From the Logic toolbox: Get and place a **comparison** block into the ‘**true**’ space in this ‘if’ line of code.
80+
- From the Math Toolbox: Get and place an **operation** block into the **left side of the comparison block**.
81+
- From the Input…more Toolbox: Get and place a ‘**running time(ms)**’ block into the **left side of the math operation block**.
82+
- Set the **math operation** to **minus (-)**.
83+
- From the Variables Toolbox: Get and place a ‘**TimeStarted**’ block into the **right side of the math operations block**.
84+
- Set the **comparison** block symbol to ‘**greater than****(>)**.
85+
- Set the value on the **right-hand side of the comparison block** to **10000** (ten seconds).
86+
87+
```block
88+
basic.forever(function () {
89+
if (input.acceleration(Dimension.Z) < -700) {
90+
let TimeStarted = 0
91+
basic.showLeds(`
92+
# . . . .
93+
# . . . .
94+
# # # # .
95+
# . . # .
96+
# . . # .
97+
`)
98+
if (input.runningTime() - TimeStarted > 10000) {
99+
100+
}
101+
} else {
102+
basic.showLeds(`
103+
. . # . .
104+
# # # # #
105+
. . # . .
106+
. # . # .
107+
. # . # .
108+
`)
109+
}
110+
})
111+
```
112+
113+
## Check for Understanding
114+
115+
This if statement tells the micro:bit to check the difference between when we started the program and now. If the difference between when the program started and now is greater than 10 seconds, do something.
116+
117+
We will have the micro:bit flash a message to indicate that you have been sitting longer than the desired time.
118+
119+
NOTE: We’re using 10 seconds here for demonstration and testing purposes. In reality, you would want to set the time somewhere closer to half an hour, which is 1,800,000 milliseconds.
120+
121+
5. From the Loops Toolbox: Get and place a ‘**repeat**’ block under the **if statement** we just created.
122+
- From the Basic Toolbox: Get one ‘**show leds**’ block, one ‘**clear screen**’ block, and two ‘**pause**’ blocks.
123+
- Place the ‘**show leds**’ block inside the ‘**repeat**’ block.
124+
- Create an arrow image or an image of your choosing in this block. This image will flash on the micro:bit screen to alert the user that it’s time to stand up!
125+
- Place one of the ‘**pause**’ blocks below this ‘**show leds**’ block.
126+
- Place the ‘**clear screen**’ block just below the ‘**pause**’ block.
127+
- Place the second ‘**pause**’ block just below the ‘**clear screen**’ block.
128+
129+
130+
131+
```blocks
132+
basic.forever(function () {
133+
if (input.acceleration(Dimension.Z) < -700) {
134+
let TimeStarted = 0
135+
basic.showLeds(`
136+
# . . . .
137+
# . . . .
138+
# # # # .
139+
# . . # .
140+
# . . # .
141+
`)
142+
if (input.runningTime() - TimeStarted > 10000) {
143+
for (let index = 0; index < 4; index++) {
144+
basic.showLeds(`
145+
. . # . .
146+
. # # # .
147+
# . # . #
148+
. . # . .
149+
. . # . .
150+
`)
151+
basic.pause(100)
152+
basic.clearScreen()
153+
basic.pause(100)
154+
}
155+
}
156+
} else {
157+
basic.showLeds(`
158+
. . # . .
159+
# # # # #
160+
. . # . .
161+
. # . # .
162+
. # . # .
163+
`)
164+
basic.pause(100)
165+
basic.clearScreen()
166+
basic.pause(100)
167+
}
168+
})
169+
```
170+
171+
In addition to this flashing image, let’s add a message!
172+
173+
6. From the Basic Toolbox: Get and place a ‘**show string**’ block below the ‘**repeat**’ loop block.
174+
- Write a short message reminding the user to stand up!
175+
- When the user stands up, they will see the person standing image.
176+
- In case the user sits back down again, we need to reset the **TimeStarted** variable to the current program runtime.
177+
- From the Variables Toolbox: Get and place a ‘**set TimeStarted**’ block just below the image of the person standing in the else section of the code.
178+
- From the Input…more Toolbox: Get and place a ‘**running time(ms)**’ block into the right side of the ‘**set TimeStarted**’ block.
179+
180+
Note: You can also manually restart the program each time you sit back down by pressing the micro:bit’s reset button or by turning the battery pack on and off (if your battery pack has an on/off switch.)
181+
182+
183+
## Complete program
184+
185+
Here is the complete Stand Up! program:
186+
187+
```blocks
188+
let TimeStarted = 0
189+
basic.forever(function () {
190+
if (input.acceleration(Dimension.Z) < -700) {
191+
basic.showLeds(`
192+
# . . . .
193+
# . . . .
194+
# # # # .
195+
# . . # .
196+
# . . # .
197+
`)
198+
if (input.runningTime() - TimeStarted > 10000) {
199+
for (let index = 0; index < 4; index++) {
200+
basic.showLeds(`
201+
. . # . .
202+
. # # # .
203+
# . # . #
204+
. . # . .
205+
. . # . .
206+
`)
207+
basic.pause(100)
208+
basic.clearScreen()
209+
basic.pause(100)
210+
}
211+
basic.showString("Stand Up!!")
212+
}
213+
} else {
214+
basic.showLeds(`
215+
. . # . .
216+
# # # # #
217+
. . # . .
218+
. # . # .
219+
. # . # .
220+
`)
221+
basic.pause(100)
222+
basic.clearScreen()
223+
basic.pause(100)
224+
TimeStarted = input.runningTime()
225+
}
226+
})
227+
```
228+
229+
Solution link: [https://makecode.microbit.org/S25983-43564-75646-69984]()
230+
231+
## Knowledge Check
232+
233+
**Questions:**
234+
235+
1. What does velocity measure?
236+
2. What does acceleration measure?
237+
3. In the **Stand for Health!** activity, what did the TimeStarted block measure?
238+
4. Using pseudocode, describe what these code blocks do.
239+
240+
```blocks
241+
basic.forever(function () {
242+
if (input.acceleration(Dimension.X) < -700) {
243+
basic.showLeds(`
244+
# . . . .
245+
# . . . .
246+
# # # # .
247+
# . . # .
248+
# . . # .
249+
`)
250+
} else {
251+
basic.showLeds(`
252+
. . # . .
253+
# # # # #
254+
. . # . .
255+
. # . # .
256+
. # . # .
257+
`)
258+
}
259+
})
260+
```
261+
262+
**Answers:**
263+
264+
1. Velocity measures how fast an object’s position is changing over time, in both speed and direction.
265+
2. Acceleration measures an object’s change in velocity.
266+
3. The TimeStarted block measured the number of milliseconds that had passed since the start of the program.
267+
4. If the micro:bit is lying flat, the screen will display a chair. If its position changes from lying flat, it will show a person standing.

0 commit comments

Comments
 (0)