micro:bit file sizes
Posted on 06 February, 2017
So the son was writing some MicroPython code for micro:bit (using the web editor) a couple of days ago, and hit an unexpected error; a script that he was editing — which had worked perfectly well — suddenly stopped reacting to button presses and even started showing errors when trying to flash it from his Mac.
After a little trial and error we found out that there is a maximum file size for MicroPython scripts of 8kB (which doesn't feel like a lot!) — this is possibly a little smaller than some other languages on the micro:bit, with the MicroPython language taking up the rest of the available storage on the device.
The script that he was writing had expanded out to nearly 200 lines, a lot of which was comments (which I'd recommended he add!) — so he was able to strip it back down to hit the file-size limit — but come on Micro:Bit Educational Foundation, you should really add a feature to the bug-checker so that it warns when a file is too large to be transferred!
Posted in microbit