[Microbit-Python] Automating upyed copy hex file to micro:bit

Damien George damien.p.george at gmail.com
Sun Nov 15 16:24:21 EST 2015


Hi Tom,

There is a script called "pyboard.py" which can be used to execute a
script from your PC on the device.  Find it here:
https://github.com/bbcmicrobit/micropython/blob/master/tools/pyboard.py

There are instructions at the top of that file on how to use it.  I
think it'll make your life much easier!

Note that you may need to reset the device (using the reset switch on
the back) before running pyboard.py each time, especially if you're
downloading a big script.

Also note that large scripts will fail to run due to out-of-memory
errors.  This is because pyboard.py is downloading the entire script
into RAM, and then compiling it.  If you run into this problem then
you need to revert to the .hex file way of doing things (which can run
roughly 3 times script size as pyboard.py).

Happy hacking!

Cheers,
Damien.


On Sun, Nov 15, 2015 at 8:59 PM, Tom Viner <tom at viner.tv> wrote:
> Hi all,
>
> Now that's I've got my own micro:bit (for a week), as part of microworldtour
> I've been playing around in the upyed editor and trying out the examples.
>
> It doesn't take long to get bored of having to drag the new hex file over on
> each change. I've been keeping up with this mailing list, and I'm surprised
> this hasn't come up before?
>
> Now long term, people have mentioned making more of an IDE, that I'm sure
> would take care of this. But for the moment this is my solution:
>
> https://github.com/tomviner/upyflashed
>
> Comments welcome. It's only tested on Ubuntu so far. In particular it
> guesses your browser download directory will be at ~/Downloads and uses
> psutil to read your mounted drives looking for one ending in "MICROBIT", but
> you can also pass params to the upyflashed command.
>
> Cheers,
> Tom
>
>
>
> _______________________________________________
> Microbit mailing list
> Microbit at python.org
> https://mail.python.org/mailman/listinfo/microbit
>


More information about the Microbit mailing list