This repository is provides the tooling needed to compile a C/C++ CODAL program for the micro:bit v2 and produce a HEX file that can be downloaded to the device.
Any issues regarding the micro:bit are gathered on the lancaster-university/codal-microbit-v2 repository. Please raise yours there too.
You need some open source pre-requisites to build this repo. You can either install these tools yourself, or use the docker image provided below.
We use Ubuntu Linux for most of our tests. You can also install these tools easily through the package manager:
sudo apt install gcc
sudo apt install git
sudo apt install cmake
sudo apt install gcc-arm-none-eabi binutils-arm-none-eabi
For backwards compatibility with microbit-samples users, we also provide a yotta target for this repository.
- Clone this repository
- In the root of this repository type
python build.py - The hex file will be built
MICROBIT.HEXand placed in the root folder.
You will find a simple main.cpp in the source folder which you can edit. CODAL will also compile any other C/C++ header files our source files with the extension .h .c .cpp it finds in the source folder.
The samples folder contains a number of simple sample programs that utilise you may find useful.
This repository is designed to follow the principles and APIs developed for the first version of the micro:bit. We have also included a compatilibty layer so that the vast majority of C/C++ programs built using microbit-dal will operate with few changes.
API documentation is embedded in the code using doxygen. We will produce integrated web-based documetation soon.