Source: cirosantilli/compile-micropython-code-for-micro-bit-locally

= Compile MicroPython code for Micro Bit locally

* https://stackoverflow.com/questions/73425359/is-it-possible-to-compile-microbit-python-code-locally
* https://stackoverflow.com/questions/52691853/generating-micropython-python-code-hex-file-from-commandline

To use a prebuilt firmware, you can just use `uflash`, tested on <Ubuntu 22.04>:
``
git clone https://github.com/bbcmicrobit/micropython
cd micropython
git checkout 7fc33d13b31a915cbe90dc5d515c6337b5fa1660
uflash examples/led_dance.py
``
What that does is:
* convert the <MicroPython> code to bytecode
* join it up with a prebuilt firmware that ships with uflash which contains the MicroPython interpreter
* flashes that

To build your own firmware see:

Got it working: <Compile MicroPython code for Micro Bit locally on Ubuntu 22.04 with your own firmware>