[Microbit-Python] Fwd: micro:bit Mu/MicroPython questions

David Ferrington David at Alphadene.co.uk
Thu Dec 21 06:41:29 EST 2017


I’d like to raise something here - surely, it is possible not be in a loop, but still want an event to interrupt your flow, so you can deal with it and then return to the point where you were interrupted.

— David 
-- 
Accuracy Transcends Speed

> On 21 Dec 2017, at 10:29, Nicholas H.Tollervey <ntoll at ntoll.org> wrote:
> 
> On 20/12/17 23:12, George Bertsch wrote:
>> I also have felt the lack of documentation.  For example, I know
>> microbit supports interrupts because I found
>> www.microbit.co.uk/functions/on-button-pressed
>> <http://www.microbit.co.uk/functions/on-button-pressed>    in a Google
>> search.  But I have no clue how to find
>> the corresponding python module.  
>> 
> 
> The documentation is here:
> 
> https://microbit-micropython.readthedocs.io/en/0.9/
> 
> Please remember that EVERYTHING to do with MicroPython on the micro:bit
> was created by a community of volunteers. If you feel there are gaps in
> the documentation you are most welcome to contribute a pull-request for
> documentation that fills the gap.
> 
> There are TWO official development platforms for the micro:bit:
> MicroPython and Microsoft's MakeCode. MakeCode is an event driven
> JavasScript based platform hence the function you're looking at for
> Blocks and MakeCode (as it says on the page to which you link).
> 
> MicroPython has taken a different approach: we expect people to
> explicitly create an "event loop" (because, as the Zen of Python says,
> "Explicit is better than implicit" and we believe it important that
> learners understand there's a loop involved here). As you'll see from
> the API docs for the button objects in MicroPython there are was_pressed
> and is_pressed methods that allow you to detect button presses.
> 
> Hope this helps,
> 
> N.
> 
> _______________________________________________
> Microbit mailing list
> Microbit at python.org
> https://mail.python.org/mailman/listinfo/microbit

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/microbit/attachments/20171221/96e005c1/attachment.html>


More information about the Microbit mailing list