[Microbit-Python] microbit_stub - a Python module to test micro:bit Python programs

Nick Cook nick.cook at newcastle.ac.uk
Wed Jun 15 05:10:27 EDT 2016


Thanks

I hope it lives up to your expectations :)

My priority was to deal with the display, buttons, and I/0 pins.

Gestures are randomly generated as are compass positions. I think it would be easy to include gestures as part of the "microbit state". I didn't because I ran out of time and wanted to release it.

An overall aim is to keep things as simple as possible and hopefully easy to understand. I will leave it to others to decide whether I have achieved that :)

I have not tried to do anything about serial interface or bluetooth. I am not sure it is sensible to.

Nick


On 14/06/16, Nicholas H.Tollervey wrote:
> Hi Nick,
>
> Briefly, because I have a busy evening ahead of me... wow - I can't wait
> to play with this. Congratulations..!
>
> I'll play with it tomorrow ;-)
>
> N.

On 14/06/16 18:22, Nick Cook wrote:
>
 I have released my microbit_stub module on github. It is  a Python
> module to test microbit micropython programs without needing a physical
> micro:bit, completely offline. You can do what you will with it from the
> github home:
>
> <https://github.com/casnortheast/microbit_stub>https://github.com/casnortheast/microbit_stub
>
> It as a textual "emulator" of the micro:bit (as defined by the microbit
> micropython API) that allows you to take a microbit micropython program
> and test it using the microbit_stub module. It is intended to be useful
> if you do not have a micro:bit, or if you are not using the offline mu
> editor with a REPL window and need something more than the error
> feedback on the micro:bit screen. Or it can just be used by pupils (and
> others!) to test program syntax and logic before running on the
> micro:bit (or after if they get an error and cannot easily work out what
> the problem is). Programs using this module should run in any Python IDE
> (including IDLE) and at the command line.
>
> Some documentation, tests and example programs are on the github page
> (including simple support for simulation of microbit state).
>
> It should work with any microbit program by changing the import
> statement to import "microbit_stub" instead of "microbit". There is also
> a sub directory in the release that uses "microbit" as the module name
> and, therefore, does not require any change to an existing program (you
> will see from the README that I am not undecided about which approach to
> take :).
>
> I may at some point extend the module to provide a graphical emulation
> (or the option of it). Peter Dring has produced a Web-based micro:bit
> Python simulator that could also be of interest (it is intended for a
> different usage to this module) -
> see: http://community.computingatschool.org.uk/resources/4479. And there
> is David Whale's minecraft micro:bit,
> see: https://github.com/whaleygeek/mc_microbit. There may be others.
>
> Nick
>
> Nick Cook
> Lecturer in Computing Science at Newcastle University
> and lead of CAS North East: http://casne.ncl.ac.uk/
>
>
>
> _______________________________________________
> Microbit mailing list
> Microbit at python.org<https://mail.python.org/mailman/listinfo/microbit>
> https://mail.python.org/mailman/listinfo/microbit
>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/microbit/attachments/20160615/01017016/attachment-0001.html>


More information about the Microbit mailing list