[Microbit-Python] MicroPython micro:bit metronome hardware / IO testing

Damien George damien.p.george at gmail.com
Mon Sep 7 22:50:57 CEST 2015


Nicholas:

1. Smart indenting is now implemented (4 spaces, plus backspace over 4 spaces).

2. When a script finishes (either CTRL-C or script just ends) the REPL
will have all global objects defined by the script.  They will be
accessible using dir() and tab completion will pick them up.  This is
already a standard feature of Python.



On Mon, Sep 7, 2015 at 8:31 AM, Nicholas H.Tollervey <ntoll at ntoll.org> wrote:
> Morning!
>
> It's funny that you pick up on the "live coding" aspect of this (rather
> than the IO hack that I was trying to demo). :-)
>
> Totally get the problems with making mistakes and typing in the REPL.
> Damien, auto-indenting (4 spaces please!) would be very handy. I also
> agree that splitting things into functions would be the way to go - but
> I was in a rush.
>
> I also think it a "feature" that if you've flashed a script onto the
> device and you drop into the REPL you'll see all your code is in scope
> (e.g. dir() will return all the expected things). I believe this is a
> HUGE win for the purposes of testing and playtime.
>
> Anyway, glad you enjoyed it. More stuff coming soon.
>
> N.
>
> On 06/09/15 21:47, Damien George wrote:
>> Very cool Nicholas!
>>
>> I agree with David that it's very fragile if you type something wrong
>> in the script (you did very well Nicholas to get it correct first time
>> on camera!).
>>
>> I guess the first thing you'd do would be break the code into simple
>> functions, ones you can test individually.  Then it's easy to modify
>> on the fly.
>>
>> BTW, I can add auto-indenting if you think that would be helpful (I
>> think it is).
>>
>> Cheers,
>> Damien.
>>
>>
>> On Sun, Sep 6, 2015 at 9:43 PM, David Whale <david at thinkingbinaries.com> wrote:
>>> Love it!
>>>
>>> All we need now is a resident editor, and we have a BBC Micro just like the
>>> 1980's.
>>>
>>> No, seriously, I mean this as a good thing - typing interactively is magic,
>>> but if you make a typing error, you have to type the whole lot in again
>>> (just like with the python shell). A simple resident editor, and you don't
>>> need *anything* else to use your microbit!
>>>
>>> I've always loved the live coding feel of interactive python, interactive
>>> lua, interactive ruby, that's why I like those languages so much. (live
>>> coding with Python and Minecraft is huge fun by the way) It is so easy to
>>> "run a little live experiment" to see how something works, then switch back
>>> to your bigger program you are editing and knit it all together into a
>>> bigger application.
>>>
>>> D
>>>
>>>
>>> ___________________________________________________________
>>> David Whale, B.Sc (Hons), MIET
>>> Software Engineer and IET Schools Liaison Officer, Essex
>>>
>>> email:  dwhale at theiet.org
>>> twitter: @whaleygeek
>>> blog:  blog.whaleygeek.co.uk
>>>
>>> Co-author of the new book "Adventures in Minecraft" - lets get kids coding!
>>>
>>>
>>> On 6 September 2015 at 19:53, Nicholas H.Tollervey <ntoll at ntoll.org> wrote:
>>>>
>>>> Hi Folks,
>>>>
>>>> Watch this video (Howard, yes, it's private):
>>>>
>>>> https://www.youtube.com/watch?v=Ghdt0WMIe3c
>>>>
>>>> Basically, Damien has connected up the IO API in the DAL and I spent
>>>> half an hour this evening testing it with a numpty hardware project (the
>>>> metronome). As you can see I'm having quite a lot of fun.
>>>>
>>>> I've not forgotten about the API work... but I started a new contract
>>>> last week and that has been taking up a lot of my time. Expect
>>>> documentation and other things from me over this coming week. Both
>>>> Damien and I have been making progress in terms of enhancing the
>>>> capabilities of MicroPython on the micro:bit (e.g. from my perspective,
>>>> output from help() is meaningful to 11yo kids and there's even an
>>>> "import this" with appropriate micro-poem, for fun).
>>>>
>>>> Finally, both Damien and I will be at PyCon UK and sprinting on the
>>>> MicroPython / micro:bit work on the Monday. Come join us, you may get a
>>>> special "gift" to take home with you and/or a chance for some Pythonic
>>>> posterity. ;-)
>>>>
>>>> As always, comments, constructive critique and ideas most welcome!
>>>>
>>>> Best wishes,
>>>>
>>>> Nicholas.
>>>>
>>>>
>>>> _______________________________________________
>>>> Microbit mailing list
>>>> Microbit at python.org
>>>> https://mail.python.org/mailman/listinfo/microbit
>>>>
>>>
>>>
>>> _______________________________________________
>>> Microbit mailing list
>>> Microbit at python.org
>>> https://mail.python.org/mailman/listinfo/microbit
>>>
>> _______________________________________________
>> Microbit mailing list
>> Microbit at python.org
>> https://mail.python.org/mailman/listinfo/microbit
>>
>
>
>
> _______________________________________________
> Microbit mailing list
> Microbit at python.org
> https://mail.python.org/mailman/listinfo/microbit
>


More information about the Microbit mailing list