#Adafruit macropad display

1 messages · Page 1 of 1 (latest)

valid root
#

I'm trying to access some of the functions of the SH1106 OLED on my macropad, for example, controlling the brightness and sleep function etc., but couldn't find any documentation around that.

I know there's a brightness prop for macropad.display, but don't know the parameter range, is it 0-1 or 0-255 or something else? And for the sleep function, looks like there's a sleep function in the SSD1306 library, but when I try to use macropad.display.sleep() it complains about AttributeError: 'Display' object has no attribute 'sleep', any suggestions?

tame bramble
#

not sure which example you're using but if you're using the adafruit_displayio_ssd1306 library then try adafruit_displayio_ssd1306.sleep and adafruit_displayio_ssd1306.wake

#
    def brightness(self) -> float:
        """Overall brightness of the pixel (0 to 1.0)."""
        return self._pixels.brightness
``` brightness value is from 0 to 1.0
#
from adafruit_macropad import MacroPad

macropad = MacroPad()

macropad.pixels.brightness = 0.5

while True:
    macropad.pixels.fill((0, 255, 0))
valid root
#

ah ok thanks for explaining, I just thought macropad library is bringing in all the functions from its underlaying display library, apparently not. So what's the proper way to making the oled go to sleep in this case? Using ssd1306 library is the proper way?

valid root
#

also for brightness, I didn't mean the neopixel brightness, that one is well documented, but I'm talking about the oled display's brightness

#

I see there's a prop named brightness under macropad.display.brightness, I just tried setting it to 0 and 1, doesn't change anything

#

I'm having trouble finding any documentation for that prop.

sly shoal
#

@valid root the Macropd display is builtin it doesn't use the python library, you can set the brightness to 0, which makes it darker on my Macropad, but doesn't turn it off. That might be a known bug, I'll see if I find it.
But it's an oled, turning it off is as simple as displaying nothing, so it depends on how you use it, but you can set group.hidden = True on the base group displayed on the screen (the one that you call display.show(...) on)