Skip to content

Commit ce03148

Browse files
committed
finish first program guide
1 parent c73f33b commit ce03148

6 files changed

Lines changed: 85 additions & 2 deletions

File tree

.astro/data-store.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/content/docs/microcode/create.mdx

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ title: Creating a new program
33
description: Program with MicroCode, starting with an empty program
44
---
55

6+
## Start afresh
7+
8+
Open the samples menu and select the empty program,
9+
as shown below.
10+
611
<CardGrid>
712
<Card title="Select samples tile">
813
![microcode](./create/mc-home-samples.png)
@@ -12,6 +17,14 @@ description: Program with MicroCode, starting with an empty program
1217
</Card>
1318
</CardGrid>
1419

20+
## Press `d-A` to create your first rule
21+
22+
The editor should be open on the empty program
23+
with the cursor in the **When** section of the first
24+
rule. Press `d-A` to bring up the **When** menu, which
25+
lists the various events to choose from. The `press`
26+
event tile is selected. Press `d-A` to insert
27+
the press tile into the rule.
1528

1629
<CardGrid>
1730
<Card title="The empty program">
@@ -22,16 +35,39 @@ description: Program with MicroCode, starting with an empty program
2235
</Card>
2336
</CardGrid>
2437

38+
## Select the button to recognize
39+
40+
As shown below, the cursor should now be on the empty tile
41+
to the right of the `press` tile.
42+
43+
Press the `d-A` button again
44+
to bring up the menu that lists the options
45+
for which "pressable" items the micro:bit offers,
46+
which includes the `m-A` and `m-B` buttons,
47+
as well as the micro:bit logo and the three
48+
large pins (labelled 0, 1, and 2) on the
49+
micro:bit's edge connector.
50+
51+
Press `d-A` to select the `m-A` button.
52+
2553

2654
<CardGrid>
2755
<Card title="First tile created!">
2856
![microcode](./create/mc-empty-3.png)
2957
</Card>
30-
<Card title="Filter menu">
58+
<Card title="Pressable options">
3159
![microcode](./create/mc-empty-4.png)
3260
</Card>
3361
</CardGrid>
3462

63+
## When complete, move to Do!
64+
65+
Now that you have finished the **When** section of the rule,
66+
the cursor now is in the **Do** section, as shown below.
67+
Click the `d-A` button to bring up the menu of
68+
actions to select from. The `show image` tile is selected
69+
by default. Press `d-A` again to insert the tile.
70+
3571
<CardGrid>
3672
<Card title="When section complete">
3773
![microcode](./create/mc-empty-5.png)
@@ -41,6 +77,53 @@ description: Program with MicroCode, starting with an empty program
4177
</Card>
4278
</CardGrid>
4379

80+
## Start your first image
81+
82+
Now, press `d-A` again to bring up a two-tile menu
83+
with the image editor tile selected (the other tile
84+
is the repeat tile). Press `d-A` to enter the image
85+
editor.
86+
87+
<CardGrid>
88+
<Card title="Show image inserted">
89+
![microcode](./create/mc-empty-7.png)
90+
</Card>
91+
<Card title="Choose image editor">
92+
![microcode](./create/mc-empty-8.png)
93+
</Card>
94+
</CardGrid>
95+
96+
## Edit the image
97+
98+
99+
Use the direction pad to move around the 5x5 LED
100+
matrix; press `d-A` to toggle the state of the
101+
LED the cursor is on. When you are finished designing
102+
your image press `d-B` to exit the image editor.
103+
104+
You have finished your first MicroCode When-Do rule!
105+
106+
<CardGrid>
107+
<Card title="LED image editor">
108+
![microcode](./create/mc-empty-9.png)
109+
</Card>
110+
<Card title="First rule completed!">
111+
![microcode](./create/mc-empty-10.png)
112+
</Card>
113+
</CardGrid>
114+
115+
## Run your program
116+
117+
You can run the program in one of three ways:
118+
119+
- use the direction pad to navigate to the green play tile and press `d-A`
120+
- press either the `m-A` or `m-B` button on the micro:bit
121+
- press the `menu` button on the display shield
122+
123+
The micro:bit will indicate the program is running by a quick circular
124+
animation on the LED display.
125+
126+
44127

45128

46129
import { Card, CardGrid, LinkCard } from '@astrojs/starlight/components';
264 KB
Loading
256 KB
Loading
286 KB
Loading
275 KB
Loading

0 commit comments

Comments
 (0)