micro:bit mruby (microbit-mruby) aims to put an implementation of mruby 3.0 on BBC micro:bit v2
(micro:bit mruby is available on microbic:bit v2 only.)
microbit-mruby is developed by using microbit-v2-samples of Lancaster University
To compile microbit-mruby out of the source code you need the following tools:
- C Compiler (e.g. gcc or clang)
- Ruby 2.7 or later (e.g. ruby or jruby)
- Docker
- git
cd $WORKING_DIR
git clone https://github.com/mruby-Forum/microbit-mruby.git
cd microbit-mruby
git clone https://github.com/mruby/mruby.git -b 3.0.0 --depth 1
- Please set $WORKING_DIR according to your environmnent
make docker
You need to genarate the docker image for building microbit -mruby and it will take a few minutes.
cd mruby
rake MRUBY_CONFIG=../microbit.rb
cd ..
ruby make-mruby-source.rb
Note: The mruby build needs to be executed again when adding the mruby library (mrbgems)
just invoke make inside of the microvit-mruby directory.
make
When the build is completed successfully , MICROBIT.hex will be generated.
Connect to the Micro:bit via USB cable ,then Micro:bit will be appeared as a folder. Copy the MICROBIT.hex to the micro:bit folder, microbit-mruby will be launched and runs the LED lightning application Lightnig LED sample code
The source code of the mruby application executed by microbit-mruby should be described in mrbapp.rb. If you have changed the contents of mrbapp.rb, please execute the above build microbit-mruby and run the application .
Note:If you change the mruby application, the micro: bit firmware will be built again
- Ruby embedded class
- LED class
Note: We are preparing the details of the calss specification and planning to add more classes.
microbit-mruby is released under the MIT License. Please see LICENSE