micropython / micropython/micropython-lib

suggestion: add brightness to neopixel library

Open
#738 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.9k
Forks
1.1k
Avg merge
7d 6h
Merged PRs (30d)
3

Description

Not sure if this is the best place to do this but I thought I'd take a stab at this. The default build includes a NeoPixel library which is great, but the brightness on those things is enough to land an airliner at night, and yet there's no included way in the library to manage the brightness. On the C++ side, you can do this:

pixels.setBrightness(newBrightness);

where newBrightness is a value from 0 to 255. CircuitPython is a bit easier, you just do this:

pixels.brightness = 0.25

where the value you put in is a float between 0 and 1 (for 100%). But in both cases, setting that value recalculates the new values for each color bit and optionally redraws the string depending on if you have it set that way or not.

Would it be worth adding some basic brightness control to the existing library? Would I create a PR against this repo or against one somewhere else?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named. Start by locating the default NeoPixel library in this repository and inspect how color values are stored, updated, and optionally redrawn. Compare the requested 0–255 or 0–1 brightness behavior with the existing API; done means documented brightness control that updates color values and redraw behavior consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
embedded-iot
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.