Microsoft MicroCode is a MakeCode Arcade application that allows the creation, modification, and execution of simple reactive programs for microcontroller-based target devices such as the BBC micro:bit and Jacdac brains. MicroCode has a tile-based language and editor, inspired by Kodu Game Lab, for creating programs using just the 4-way direction pad and A and B buttons supported by Arcade-compatible devices. The language is parameterized by a set of Jacdac services that represent the set of hardware features of the target device (the device to be programmed). The programs are compiled into the bytecode of the Jacdac virtual machine and persisted in the flash memory of the target device.
- install Node.js
npm install -g makecode- clone this repo
- in this repo, run
mkc init(one time only) - run
mkc serve - head to http://127.0.0.1:7001 for simulator
- run
mkc build -dto compile and deploy to device
To load the local editor in a Jacdac devtools page,
To bump and refresh the github pages javascript,
sh ./bump.sh
sh ./release.sh
then commit the generated files.
This little app packs a lot into a small footprint: graphics, UI, editor, compiler, and runtime. Read more...
This app is built with MakeCode Arcade, 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:
- https://github.com/microsoft/codal-jacdac: an add-on to CODAL that provides Jacdac runtime, virtual machine, and services representing micro:bit features
- https://github.com/microsoft/pxt-arcade: the MakeCode Arcade editor, with support for NFR52833, the MCU of the micro:bit V2, which depends on
- https://github.com/mmoskal/codal-nrf52833-dk: micro:bit device drivers
- https://github.com/lancaster-university/codal-nrf52: CODAL runtime for NRF52 class MCUs
- https://github.com/lancaster-university/codal-core: CODAL runtime
We are working to expose most of the micro:bit's main features in MicroCode:
- LED screen
- design and display icons and animations
- plot the value of a sensor
- User input
- buttons A and B
- capacative touch on micro:bit logo, pins 0, 1 and 2
- Accelerometer
- respond to accelerometer events
- access to X, Y, Z values
- Sensors
- temperature
- light level
- compass
- Music
- play tones via the speaker
- Radio
- set group
- send and receive messages
- Data
- record data to flash
- display data
MicroCode integrates with Jacdac in several ways
- the MicroCode program is compiled to the bytecode of the Jacdac virtual machine (JDVM), which can be run on the same micro:bit or exported to other micro:bits
- the MicroCode editor recognizes a small set of Jacdac modules, when connected, providing programming tiles for those modules
The MicroCode language owes much to Kodu Game Lab. Read more...
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.