adafruit / Adafruit_CircuitPython_NeoTrellis

CircuitPython library for the Adafruit RGB Trellis
MIT License
8 stars 14 forks source link

Add brightness getter/setter. #17

Closed CedarGroveStudios closed 2 years ago

CedarGroveStudios commented 2 years ago

Add a property to read and set NeoPixel array brightness levels for both the single NeoTrellis board driver neotrellis.py and the multiple-board driver multitrellis.py. Also updated the two examples to include use of the new property.

# Set the brightness value (0 to 1.0)
trellis.brightness = 0.5

The brightness property is passed to the underlying neopixel driver class where brightness values in the range of 0.0 to 1.0 are verified.

Tested on an 8x8 NeoTrellis device consisting of four 4x4 NeoTrellis boards and a Feather M4 Express running CircuitPython 7.3.0.

Adafruit CircuitPython 7.3.0 on 2022-05-23; Adafruit Feather M4 Express with samd51j19

jedgarpark commented 2 years ago

Nice, I was just doing multi-trellis stuff and can use this. I’ll test when I’m back next week.

jedgarpark commented 2 years ago

I just tested it on the NeoTrellis 8x8 and it works beautifully! Thanks, this makes it much easier to pick colors and deal with brightness separately.

CedarGroveStudios commented 2 years ago

Thank you, John!

CedarGroveStudios commented 2 years ago

@ladyada Please let me know if there's anything I can do to help move this forward towards the merge.

jepler commented 2 years ago

@CedarGroveStudios it looks like there's a file that needs a conflict resolved. Are you familiar with this process, or would you like a hand?

CedarGroveStudios commented 2 years ago

@CedarGroveStudios it looks like there's a file that needs a conflict resolved. Are you familiar with this process, or would you like a hand?

@jepler Thanks for your offer to help. I’ll see if I can fix it myself. I only submit a couple of PRs in a year, so it takes me a while to relearn and discover all the new environment changes.

CedarGroveStudios commented 2 years ago

Resolved, retested on the 8x8 NeoTrellis, and resubmitted. Should be good to go.

jepler commented 2 years ago

Thank you! Merging based on JP's earlier review