3 ms·
Everytime I've seen mention of Micropython, mostly on Hackaday projects, I see comments that are very negative, mostly questioning the purpose of running an int
by mk_stjames 2y ago
Everytime I've seen mention of Micropython, mostly on Hackaday projects, I see comments that are very negative, mostly questioning the purpose of running an interpreter, especially a subset of python, at all on a uC.
There are plenty of reasons, but I actually have one that I never see mentioned:
Because the code is interpreted, the main.py file is always there in the original form - no binary. On a Pi Pico for example I can just pull the main.py file that is stored in flash on the Pico and see the original code just by connecting to USB.
Why is that handy? Well, of course not having to compile every time before flashing to the uC is nice. But the big thing for me is, if I ever forget what the hell I wrote that is running on a project... instead of having to dig through my files and find the C source I compiled and then figure out how I compiled it etc etc etc... I can just plug into the uC and download the python file and read what I wrote. If I have a little machine, maybe a specialty oven temp controller and I want to add a sensor reading to the LCD display but I did the project years ago in a hurry and don't want to try and look up the source code and reinstall the compiler toolchain- fine, just plug in via USB, the python file is there in the flash storage, open it up, modify what I want, and save back to it and restart the interpreter and the new script runs.
It's a way for projects to better 'self-document' themselves.