nrf-rs / microbit

A Rust crate for BBC micro:bit development
BSD Zero Clause License
276 stars 61 forks source link

Display is flickery with a micro:bit 2 #126

Closed mattheww closed 9 months ago

mattheww commented 9 months ago

The current display code is showing each (internal) row of LEDs for 6ms.

For the micro:bit v1, where there are three rows of LEDs internally, that means the whole display refreshes every 18ms.

This is the same timing that microbit-dal uses for the micro:bit v1.

But the micro:bit v2 has five rows internally, which means the whole display refreshes every 30ms. That looks visibly flickery to me.

codal-microbit-v2 uses 3⅓ms per row. I think we should adopt those timings.

mattheww commented 9 months ago

The above figures are for display::nonblocking.

display::blocking defaults to a 2ms refresh per row, giving 6ms whole-display refresh for the micro:bit v1 and 10ms whole-display refresh for the micro:bit v2.

mattheww commented 9 months ago

I think the pragmatic thing is to double the frequency for the micro:bit v2, rather than calculating a whole new GREYSCALE_TIMINGS table and teaching tiny-led-matrix to use it.