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

Questions and discussion about running MicroPython on a micro:bit board.
Target audience: MicroPython users with a micro:bit.
plummet
Posts: 3
Joined: Sat Apr 01, 2017 2:34 pm

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

Postby plummet » Sat Apr 01, 2017 2:49 pm

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

fizban
Posts: 24
Joined: Mon Oct 24, 2016 2:32 pm

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

Postby fizban » Sun Apr 02, 2017 5:28 pm

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.

plummet
Posts: 3
Joined: Sat Apr 01, 2017 2:34 pm

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

Postby plummet » Sun Apr 02, 2017 6:16 pm

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

fizban
Posts: 24
Joined: Mon Oct 24, 2016 2:32 pm

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

Postby fizban » Sun Apr 02, 2017 8:53 pm

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.

plummet
Posts: 3
Joined: Sat Apr 01, 2017 2:34 pm

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

Postby plummet » Mon Apr 17, 2017 9:17 am

Hi

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

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


Return to “The micro:bit”

Who is online

Users browsing this forum: No registered users and 1 guest