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

George Bertsch gfbertsch at gmail.com
Thu Dec 21 20:42:08 EST 2017


Thanks!  "was_pressed" will serve my purposes.
George Bertsch

On Thu, Dec 21, 2017 at 2:29 AM, 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/d1891c68/attachment.html>


More information about the Microbit mailing list