logo

Set Brightness(0) does not work

PROBLEM

I get a strange pattern on the display on the hardware when using setbrightness(0)

setbrightness does not work

The simulator and the real hardware seem to work differently.

CAUSE

https://github.com/lancaster-university/microbit-dal/issues/281

There is a bug in the currently deployed display driver, in that if the number ‘0’ is used for brightness, the display driver code returns prematurely. This prevents it from updating the display, you might see only some of the LEDs turned on depending on which of the 3 ROW multiplexes was active in the driver at the time the set_brightness() was called
WORKAROUND

Use setbrightness(1) instead

EXAMPLES

These two .hex files demonstrate the problem, and the workaround. They are written in blocks (www.microbit.co.uk/app) so just drag and drop them onto your MICROBIT drive, or drag and drop them onto the www.microbit.co.uk/app editor to see the source code program.

LAST REVIEWED

0 found this helpful
All for Joomla All for Webmasters