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
{{ message }}
This repository was archived by the owner on Aug 13, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+2-29Lines changed: 2 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,33 +1,6 @@
1
-
## Microsoft MicroCode[https://aka.ms/microcode](https://aka.ms/microcode)
1
+
## Microsoft MicroCode
2
2
3
-
Microsoft MicroCode is an icon-based programming language and editor for young learners to code with the [BBC micro:bit V2](https://microbit.org). MicroCode allows you to program the micro:bit V2 with only an [Arcade shield accessory](#arcade-shields-for-microbit-v2) - _no other computer is required!_ If you prefer the web browser, there's also a MicroCode web app that connects to your micro:bit V2 over WebUSB.
4
-
5
-
Here's the classic micro:bit_Happy-A-button/Sad-B-button_ program in MicroCode:
6
-
7
-

8
-
9
-
## Getting started
10
-
11
-
-**Read the [MicroCode user guide](https://microsoft.github.io/microcode/docs/manual)**
12
-
-[try it now!](https://microsoft.github.io/microcode/)
13
-
14
-
## [Arcade shields](https://microsoft.github.io/microcode/docs/manual#arcade-shield) for micro:bit V2
15
-
16
-
There are various [Arcade shields](https://microsoft.github.io/microcode/docs/manual#arcade-shield) available on the market today, as shown below.
MicroCode is open source at https://github.com/microsoft/microcode and welcomes contributions.
7
-
The easiest way to get started is to open this repository in a GitHub Codespace and everything will be ready for you.
8
-
9
-
We recommend using [Visual Studio Code](https://code.visualstudio.com/) as it provides excellent support
10
-
for MakeCode editing, Git, and Codespaces.
11
-
12
-
## Codespaces setup
13
-
14
-
- open [https://github.com/microsoft/microcode](https://github.com/microsoft/microcode)
15
-
- click on `Code` drop down and select `Create Codespace on main`
16
-
- you can do your editing from VS Code online or click on `Codespaces` in lower left and select `Open in VS Code` to use the desktop version (must be installed on your machine)
17
-
- press "Ctrl + `" to open a terminal and you're ready to go!
18
-
19
-
In the future, click again on `Code` to find previously created Codespaces.
20
-
21
-
## Local Install (skip in Codespaces)
22
-
23
-
- install [Node.js](https://nodejs.org/en/)
24
-
- install the MakeCode command line tools (`mkc` for short)
25
-
26
-
```bash
27
-
npm install -g -u makecode
28
-
```
29
-
30
-
- clone this repo
31
-
32
-
```bash
33
-
git clone https://github.com/microsoft/microcode
34
-
```
35
-
36
-
- setup MakeCode project structure (one time only)
37
-
38
-
```bash
39
-
cd microcode
40
-
mkc init
41
-
```
42
-
43
-
## Build
44
-
45
-
Note that you can open terminals directly from VS Code by pressing "Ctrl + `".
46
-
47
-
- start a compilation server that will automatically compile and reload
48
-
a compile web version of the editor
49
-
50
-
```bash
51
-
sh serve.sh
52
-
```
53
-
54
-
- open to web editor at http://127.0.0.1:7001/
55
-
56
-
To flash a micro:bit,
57
-
58
-
- build a micro:bit Hex file and deploy
59
-
60
-
```bash
61
-
mkc build --hw n3 -d
62
-
```
63
-
64
-
If you are running in Codespaces, the `-d` option won't work. Instead, right click on `built/binary.hex` in the explorer and select `Download...` to download the hex file to your micro:bit.
65
-
66
-
## With Jacdac devtools
67
-
68
-
To load the local editor in a Jacdac devtools page, click on the **sim** link at the bottom
69
-
of the local server on http://127.0.0.1:7001/. Or,
To preview all artwork, click on the `art` icon at the bottom right of the local editor (and wait...). Use `save` to download all artwork on the `images/generated` folder.
76
-
77
-
If you want to create/edit new sprites, you should import this web site into https://arcade.makecode.com, using the following directions:
78
-
79
-
- create 16 x 16 sprite in assets.ts (contains all the artwork for MicroCode)
80
-
- copy the code from the JavaScript view of https://arcade.makecode.com
81
-
- paste code into assets.ts into VS Code
82
-
- make sure it works locally
83
-
- git commit and push
84
-
85
-
You might also be able to commit and push directly from the web site, but we find that this isn't very reliable.
86
-
87
-
Some art images are precomputed, you will need to load scripts/renderart.ts in MakeCode Arcade and copy the console output back into the project.
88
-
89
-
## Updating sample
90
-
91
-
- Browse to http://127.0.0.1:7001/index.html?compress=0
92
-
- Once your sample is ready, copy the string after `#` and copy it into `samples.ts`
93
-
94
-
## Updating GitHub pages
95
-
96
-
To bump and refresh the github pages javascript and pre-built .hex file, run this script
97
-
98
-
```bash
99
-
sh ./bump.sh
100
-
```
101
-
102
-
A GitHub Action will trigger and update the web site within a few minutes.
103
-
104
-
## Running Jekyll locally
105
-
106
-
It is easiest to launch a codespace to get the right setup to run Jekyll (Ruby). Run the Jekyll setup script
107
-
108
-
```bash
109
-
sh scripts/setup-jekyll.sh
110
-
```
111
-
112
-
then launch jekyll
113
-
114
-
```bash
115
-
bundle exec jekyll serve --incremental
116
-
```
117
-
118
-
and nav to http://localhost:4000
119
-
120
-
## Re-building library
121
-
122
-
There is library of LED animations etc in `scripts/lib/lib.js`. To rebuild, make sure you have `jacscript` checked out
123
-
parallel to `microcode` and run:
124
-
125
-
```bash
126
-
cd scripts
127
-
./genlib.sh
128
-
```
129
-
130
-
## Localization
131
-
132
-
-[ ]`locales/tooltips.json` contains the tooltips displayed on the micro:bit screen
133
-
-[ ]`_includes/dialogs.html` contains the webusb dialogs
134
-
135
-
### Adding tooltips in source code
136
-
137
-
- add new tooltip to `locales/tooltips.json`
138
-
- refresh tooltips.ts
139
-
140
-
```bash
141
-
node scripts/lochex.mjs en
142
-
```
143
-
144
-
### Updating crowdin
145
-
146
-
- Go to https://crowdin.com/project/makecode/content/files
147
-
- click on `Update` for `microcode/tooltips.json` and load `locales/tooltips.json`.
148
-
149
-
### Refreshing translations
150
-
151
-
- go to https://crowdin.com/project/makecode/tools/content-delivery
152
-
- click `Release` on the microcode distribution
153
-
- bump repo
154
-
155
-
## Dependencies
156
-
157
-
This app is built with [MakeCode Arcade](https://arcade.makecode.com/), specifically targeting the NRF52833 MCU of the micro:bit V2 (for now). There are a number of repos containing the C++ of the underlying CODAL runtime:
158
-
159
-
-https://github.com/microsoft/codal-jacdac: an add-on to CODAL that provides Jacdac runtime, virtual machine, and services representing micro:bit features
160
-
-https://github.com/microsoft/pxt-arcade: the MakeCode Arcade editor, with support for NFR52833, the MCU of the micro:bit V2, which depends on
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
229
-
Any use of third-party trademarks or logos are subject to those third-party's policies.
6
+
MicroCode has moved to [https://microbit-apps.github.io/microcode-classic/docs/develop](https://microbit-apps.github.io/microcode-classic/docs/develop)
From the web editor, copy the URL... it contains your whole program.
11
-
12
-
## How do I print my program?
13
-
14
-
Click the `screenshot` button at the bottom to get a rendered image of your program that you can share and print.
15
-
16
-
## How do I translate MicroCode?
17
-
18
-
Checkout the [localization](./localization) to see how you can help or use a localized build of MicroCode.
19
-
20
-
## My micro:bit froze and is showing a number
21
-
22
-
This typically means that MicroCode had a bug and crashed. Here are a few common error codes that are scrolled on the screen:
23
-
24
-
-**540**: The .hex download was interrupted or failed. Try downloading the .hex file again.
25
-
-**020**: Out of memory! Your program is so big that it does not fit in memory anymore... or we have a memory leak somewhere. Try resetting the micro:bit.
26
-
27
-
Other error codes are [documented in MakeCode](https://makecode.microbit.org/device/error-codes).
28
-
29
-
## How do I add support for my robot?
30
-
31
-
If your robot is not [listed](./robots-supported), follow the [instructions](./robots-supported#new-robot) to get it added to the list.
32
-
33
-
## Can I help?
34
-
35
-
Yes! MicroCode is open source at https://github.com/microsoft/microcode.
6
+
MicroCode has moved here [https://microbit-apps.github.io/microcode-classic/docs/faq](here)
MicroCode will detect [Jacdac](https://aka.ms/jacdac) modules and automatically display tiles for some of them. Tiles are available for all modules in [Kittenbot Jacdac Kit A](https://microsoft.github.io/jacdac-docs/devices/kittenbot/jacdacstarterkitawithjacdaptorformicrobitv2v10/),
11
-
as as well as the [Forward Education Climate Kit](https://microsoft.github.io/jacdac-docs/devices/forward-education/climateactionkitv10/). Many of the modules in [Kittenbot Jacdac Kit B](https://microsoft.github.io/jacdac-docs/devices/kittenbot/jacdacdeveloperstoolelectronicmodulekitbv10/) also are supported.
12
-
13
-
Programming tiles for Jacdac modules appear in the user interface when the modules are connected to the shield. The Jacdac tiles have a small yellow square in the lower-right corner.
14
-
15
-
### WHEN modules
16
-
17
-
#### Sensors
18
-
19
-
-{:class="icon"} `magnet sensor` detects the presence of a magnet (levels 1 - 5, where 1 means no magnet present and 5 means strong presence of magnetic field)
20
-
-{:class="icon"} `light sensor` measures the amount of light (levels 1 - 5, where 1 means little light present and 5 means a lot of light present)
measures the amount of moisture (levels 1 - 5, where 1 means very dry and 5 means very wet)
23
-
-{:class="icon"} `distance sensor` measures the distance to an object (levels 1 - 5, where 1 means very close and 5 means far away)
whether the surface under the sensor is dark or light
26
-
27
-
#### User inputs
28
-
29
-
-{:class="icon"} `slider` measures the position of a physical slider (1-5, where 1 is minimum position and 5 is maximum position)
30
-
-{:class="icon"} `dial` has two associated events: turn left {:class="icon"} and turn right {:class="icon"}
31
-
-{:class="icon"} `key` is available in the press/release event.
32
-
33
-
### DO modules
34
-
35
-
-{:class="icon"} `LED` set a color animation on a programmable LED strip
36
-
-{:class="icon"} `relay` controls a relay switch (turning it on or off)
37
-
-{:class="icon"} `servo power` controls the power to a servo motor (turning it on or off)
38
-
-{:class="icon"} `set servo angle` controls the orientation of a servo motor arm. The {:class="icon"} `servo` arm orientation is mapped to the wall clock hours: `0` (or `12`) is on rotated 90 degree from the resting position to the left, `6` is rotated 90 degree right from the rest position. This operation depends on the servo being powered on.
39
-
40
-
### Jacdac samples
41
-
42
-
See the [following programs](./samples.md#jacdac) for examples of how to use Jacdac modules with MicroCode.
6
+
MicroCode has moved here [https://microbit-apps.github.io/microcode-classic/docs/jacdac](here)
0 commit comments