Page 1 of 2

'Best' way to program MicroPython on the micro:bit

Posted: Sat Apr 01, 2017 2:49 pm
by plummet
Hi

A newbie question..

I've been using Mu (mu-2017-01-29_15_38_04.exe for Windows) but the version of MicroPython embedded in it seems quite old:

MicroPython v1.7-9-gbe020eb on 2016-04-18; micro:bit with nRF51822

and it looks like it doesn't support pin mode setting, e.g.:

pin1.set_mode(pin.PULL_DOWN)

So, I'm wondering whether people typically use Mu or whether you use pyboard and a serial terminal, or some other method?

Also, are there releases of microbit-micropython.hex (I couldn't find any), or is it normal practise to build your own?

Thanks

Re: 'Best' way to program MicroPython on the micro:bit

Posted: Sun Apr 02, 2017 5:28 pm
by fizban
I believe pin mode setting will come in the next release, which I have the feeling will not be too far, but we still have to wait until it is ready... As with other open source projects, it will be ready when it is ready.

As per building the hex, you can just hit Flash with an empty file and the micropython hex gets transferred to the microbit. Then you can either use the REPL or simply use the File functionality to transfer a main.py file that gets executed upon boot. If you really want the hex, you can easily download it from the web version of the PythonEditor. It is called firmware.hex, but I guess it is the same that comes with Mu.

Re: 'Best' way to program MicroPython on the micro:bit

Posted: Sun Apr 02, 2017 6:16 pm
by plummet
Thanks fisban

Good to hear that pin mode is coming, but I wonder if Mu will pick it up. If I understand correctly, the underlying version of MicroPython included in the latest version of Mu is nearly a year old. There must have been a release of MicroPython for micro:bit since April 2016?

Plummet

Re: 'Best' way to program MicroPython on the micro:bit

Posted: Sun Apr 02, 2017 8:53 pm
by fizban
I also wonder the same thing, since the official documentation contains features of the upcoming release (e,g, the set mode function or the I2C init parameters), but it seems that there has not been an official release since then and the new release contains important changes that require extensive testing. From what can be read in different posts, there are less dependencies with the DAL and it is estimated that 3K might be freed for the actual programs. Mu is the main micropython desktop development tool for the micro:bit, so iI have no doubt that it will be updated to use the latest micropython release when it is ready.

Re: 'Best' way to program MicroPython on the micro:bit

Posted: Mon Apr 17, 2017 9:17 am
by plummet
Hi

I've raised an issue on the Mu GitHub to ask about this:

https://github.com/mu-editor/mu/issues/261

Re: 'Best' way to program MicroPython on the micro:bit

Posted: Thu Apr 12, 2018 2:49 pm
by tonygo
I've just installed Mu 1.0.0.Beta.15. Does this support the pin setmode with pullups and pull downs?

Re: 'Best' way to program MicroPython on the micro:bit

Posted: Sat May 12, 2018 1:55 am
by rhubarbdog
i use any old editor the create my code i then use uflash from a terminal window.

To install it i did the following

Code: Select all

sudo -H pip3 install uflash
uflash has the -r option to specify a different fimrware. I got a firmware 1.9.2 of someone on this list they had a ready compiled filrmware.hex available to download

Re: 'Best' way to program MicroPython on the micro:bit

Posted: Sat May 12, 2018 11:16 am
by tonygo
tonygo wrote:
Thu Apr 12, 2018 2:49 pm
I've just installed Mu 1.0.0.Beta.15. Does this support the pin setmode with pullups and pull downs?
Yes it does, and works very well.

Re: 'Best' way to program MicroPython on the micro:bit

Posted: Thu Jun 28, 2018 7:49 pm
by Siriushardware
As a matter of interest, the 1.0 Beta is now the default version available for download on the official Mu Website:

https://codewith.mu/en/download

At the time of writing (June 2018) it sounds as though Mu V1 (stable release) will become the current version quite soon.

Re: 'Best' way to program MicroPython on the micro:bit

Posted: Fri Jun 29, 2018 6:44 am
by tonygo
Great news - a very enjoyable editor and no more .hex files!