You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: en/step_2.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@ Open the MakeCode editor at [makecode.microbit.org](https://makecode.microbit.or
13
13
[[[makecode-tour]]]
14
14
15
15
--- task ---
16
+
16
17
### Create your project
17
18
18
19
Create and name your project:
@@ -30,6 +31,7 @@ Give your new project a name (e.g. 'Our Club') and click **Create**.
30
31
--- /task ---
31
32
32
33
--- task ---
34
+
33
35
### Make a melody
34
36
35
37
From the `Music`{:class="microbitmusic"} menu, drag the `play melody ... at tempo 120 (bpm) [until done]`{:class="microbitmusic"} block and place it inside the `forever`{:class="microbitbasic"} block.
@@ -65,6 +67,7 @@ See the melody pattern in the Editor.
Copy file name to clipboardExpand all lines: en/step_3.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
## Play and stop
2
2
3
3
--- task ---
4
+
4
5
### Button A
5
6
6
7
From the `Input`{:class='microbitinput'} menu, drag an `on button`{:class='microbitinput'} block to the code editor panel.
@@ -13,6 +14,7 @@ input.onButtonPressed(Button.A, function () {
13
14
--- /task ---
14
15
15
16
--- task ---
17
+
16
18
### Add a variable
17
19
18
20
Use a variable to track if the melody is playing.
@@ -24,6 +26,7 @@ Name your new variable `playing`.
24
26
--- /task ---
25
27
26
28
--- task ---
29
+
27
30
### Playing or not playing
28
31
29
32
From the `Variables`{:class='microbitvariables'} menu, drag a `set playing`{:class='microbitvariables'} block inside the `on button`{:class='microbitinput'} block.
@@ -63,6 +66,7 @@ input.onButtonPressed(Button.A, function () {
63
66
--- /task ---
64
67
65
68
--- task ---
69
+
66
70
### Play the melody when playing is true
67
71
68
72
From the `Logic`{:class='microbitlogic'} menu, drag an `if`{:class='microbitlogic'} block inside your `forever`{:class='microbitbasic'} block.
Copy file name to clipboardExpand all lines: en/step_5.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,7 @@ The micro:bit V2 has drum sounds you can use. These are not available for the mi
5
5
Create a drum pattern and use buttons to play bass notes.
6
6
7
7
--- task ---
8
+
8
9
### Set the tempo!
9
10
10
11
There is no pattern editor for drums, but you can still create a drum beat!
@@ -20,6 +21,7 @@ music.setTempo(120)
20
21
21
22
22
23
--- task ---
24
+
23
25
### Trigger the drums!
24
26
25
27
From the `Input`{:class='microbitinput'} menu, drag an `on logo`{:class='microbitinput'} block to the code editor panel.
@@ -33,6 +35,7 @@ input.onLogoEvent(TouchButtonEvent.Pressed, function () {
33
35
34
36
35
37
--- task ---
38
+
36
39
### Drum loop
37
40
38
41
From the `Loops`{:class='microbitloops'} menu, drag a `while`{:class='microbitloops'} block inside the `on logo`{:class='microbitinput'} block.
@@ -49,6 +52,7 @@ input.onLogoEvent(TouchButtonEvent.Pressed, function () {
49
52
--- /task ---
50
53
51
54
--- task ---
55
+
52
56
### First, the kick drum
53
57
54
58
From the micro:bit V2 section of the `Music`{:class='microbitmusic'} menu, drag a `play (🎵 ---)`{:class='microbitmusic'} block and place it in the `while`{:class='microbitloops'} block.
@@ -69,6 +73,7 @@ input.onLogoEvent(TouchButtonEvent.Pressed, function () {
69
73
70
74
71
75
--- task ---
76
+
72
77
### Add a pause
73
78
74
79
From the `Basic`{:class='microbitbasic'} menu, drag a `pause`{:class='microbitbasic'} block under your kick drum sound.
@@ -101,6 +106,7 @@ input.onLogoEvent(TouchButtonEvent.Pressed, function () {
101
106
102
107
103
108
--- task ---
109
+
104
110
### A four-four beat
105
111
106
112
Copy your `play (🎵 ---)`{:class='microbitmusic'} and `pause`{:class='microbitbasic'} blocks three times, so you have four beats and four pauses.
@@ -183,6 +189,7 @@ input.onLogoEvent(TouchButtonEvent.Pressed, function () {
183
189
--- /task ---
184
190
185
191
--- task ---
192
+
186
193
### Add some bass tones
187
194
188
195
From the `Input`{:class='microbitinput'} menu, drag two `on button`{:class='microbitinput'} blocks to the code editor panel.
@@ -223,6 +230,7 @@ input.onButtonPressed(Button.B, function () {
223
230
224
231
225
232
--- task ---
233
+
226
234
### Light and movement
227
235
228
236
**Try**: Replace the tone (e.g. 'Low C') with the `light level`{:class='microbitinput'} so that the tone changes as you move your hand over your micro:bit.
0 commit comments