'Best' way to program MicroPython on the micro:bit
'Best' way to program MicroPython on the micro:bit
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
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
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.
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
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
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
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
Hi
I've raised an issue on the Mu GitHub to ask about this:
https://github.com/mu-editor/mu/issues/261
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
I've just installed Mu 1.0.0.Beta.15. Does this support the pin setmode with pullups and pull downs?
-
- Posts: 168
- Joined: Tue Nov 07, 2017 11:45 pm
Re: 'Best' way to program MicroPython on the micro:bit
i use any old editor the create my code i then use uflash from a terminal window.
To install it i did the following
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
To install it i did the following
Code: Select all
sudo -H pip3 install uflash
-
- Posts: 20
- Joined: Wed Nov 01, 2017 8:00 pm
Re: 'Best' way to program MicroPython on the micro:bit
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.
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
Great news - a very enjoyable editor and no more .hex files!