I wrote some code to investigate the light sensor on the PyGamer and in the process of doing that discovered a few things about screen updates.
set background color to button does not appear to immediately update the screen and the next statement will run before the screen is updated. This is particularly noticeable with several background changes in succession:
I have introduced
pause blocks to try to ensure the background gets set. Empirically, these work but the number is guesswork and maybe device-specific. Is there any way to either request screen synchronisation or to wait for synchronisation?
I also was unaware that the set background color to appears to be behind any image set to set background image to. Setting a non-transparent image via latter renders
set background color to useless. I take it that’s intentional? Is it worth improving the documentation to describe this (stacking order) aspect?
Another issue I noted is if I reduce the pause that determines the duration of the on time for the
pixels (RGB NeoPixels) from 100ms to 20ms I can still see the LEDs come on every time but the readings fluctuate in a way that suggests the
light sensor is missing the illumination, perhaps 60% of the time. Is the actual value retrieved when
light sensor is used or is there some periodic, low frequency polling/sampling of the actual value going on?
And unrelated to all that and not shown, should
splash text to be consistent with
show long text?