[Microbit-Python] Slowness as integers move beyond 256

Mark Shannon mark at hotpy.org
Wed Jan 6 13:51:56 EST 2016


Hi,

We actually use an exponential scale of pwm duty-cycles, rather than bcm:
https://github.com/bbcmicrobit/micropython/blob/master/source/microbit/microbitdisplay.cpp#L193

The shortest of which is only 35 microseconds. You'll need a fast camera :)

The complete cycle to illuminate all the LEDs takes 18 millseconds.
If you could film at some multiple of that rate, then apply a low-pass
filter afterwards, you might get the correct visual effect.
I doubt it is worth the effort.

Cheers,
Mark.

On 06/01/16 18:38, David Whale wrote:
> The micro:bit uses BCM for the on screen LEDS (Binary Coded Modulation),
> and the update rate is such that it interferes quite badly with POV
> (persistence of vision) style implementations. I was chatting to Joe
> Finney at Lancaster about this and we came to the conclusion it's not
> worth 'going there', as the update rate of the display would need
> changing, and this would affect a range of other timing events.
>
> David.
>
> ___________________________________________________________
> David Whale, B.Sc (Hons), MIET
> *Software Engineer and IET Schools Liaison Officer, Essex*
>
> email: dwhale at theiet.org <mailto:dwhale at theiet.org>
> twitter: @whaleygeek
> blog: blog.whaleygeek.co.uk <http://blog.whaleygeek.co.uk>
>
> Co-author of global bestselling book "Adventures in Minecraft"
> <http://amzn.to/ZGfxZG> - lets get kids coding!
> Now in English, Spanish, Chinese and Russian.
>
>
> On 6 January 2016 at 14:04, M.-A. Lemburg <mal at egenix.com
> <mailto:mal at egenix.com>> wrote:
>
>     I've fixed the logic for calculating the argument for math.sin()
>     to always be in the range of 0..2*pi. This makes the slowness
>     go away.
>
>     BTW: I tried to film the waves display, but found that the LEDs
>     appear to be using pulse-width modulation (PWM) to output different
>     brightness levels. As a result the film doesn't show the nice
>     modulation,
>     but instead a more or less erratic blinking.
>
>     Cheers,
>     --
>     Marc-Andre Lemburg
>     eGenix.com
>
>     Professional Python Services directly from the Experts (#1, Jan 06 2016)
>     >>> Python Projects, Coaching and Consulting ...http://www.egenix.com/
>     >>> Python Database Interfaces ...http://products.egenix.com/
>     >>> Plone/Zope Database Interfaces ...http://zope.egenix.com/
>     ________________________________________________________________________
>
>     ::: We implement business ideas - efficiently in both time and costs :::
>
>         eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
>          D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
>                 Registered at Amtsgericht Duesseldorf: HRB 46611
>     http://www.egenix.com/company/contact/
>     http://www.malemburg.com/
>
>     _______________________________________________
>     Microbit mailing list
>     Microbit at python.org <mailto: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