These API changes aim to bring Mote and Mote pHAT back in harmony, so that examples can easily be ported from one to another, or code can run across devices of both types.
Fix: Added colour value scaling brightness control- APA102 brightness is not implemented in Mote's firmware.
New: Added set_clear_on_exit to determine if pixels should be cleared when the Mote library exits, defaults to False
New: Added set_all to set all pixels to a single colour
New: Added set_brightness to set the brightness value of all pixels
The brightness changes need to be reflected in the Mote library, replacing control over the 5-bit brightness value of Mote, with simple scaling of the R, G and B colour values. Since the global brightness feature controlls a ~582 Hz (https://cpldcpu.com/2014/08/27/apa102/) superimposed PWM gate to the underlying brightness value, it's less than optimal when it comes to visual flicker, and not demonstrably better than simply scaling the R, G, B values outside of extremely sophisticated dithering techniques that Mote/Mote pHAT can't support.
Following this tweak, optional Gamma correction can be added to both libraries and gamma-corrected values will no longer be broken by the APA102 hardware brightness. (in Unicorn HAT brightness is applied before gamma correction)
These API changes aim to bring Mote and Mote pHAT back in harmony, so that examples can easily be ported from one to another, or code can run across devices of both types.
This is a companion PR to https://github.com/pimoroni/mote-phat/pull/7
set_clear_on_exit
to determine if pixels should be cleared when the Mote library exits, defaults to Falseset_all
to set all pixels to a single colourset_brightness
to set the brightness value of all pixelsThe brightness changes need to be reflected in the Mote library, replacing control over the 5-bit brightness value of Mote, with simple scaling of the R, G and B colour values. Since the global brightness feature controlls a ~582 Hz (https://cpldcpu.com/2014/08/27/apa102/) superimposed PWM gate to the underlying brightness value, it's less than optimal when it comes to visual flicker, and not demonstrably better than simply scaling the R, G, B values outside of extremely sophisticated dithering techniques that Mote/Mote pHAT can't support.
Following this tweak, optional Gamma correction can be added to both libraries and gamma-corrected values will no longer be broken by the APA102 hardware brightness. (in Unicorn HAT brightness is applied before gamma correction)