Skip to content

Automatically turn on NEOPIXEL_POWER when using the NEOPIXEL pin #111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 20, 2021

Conversation

tannewt
Copy link
Member

@tannewt tannewt commented May 20, 2021

No description provided.

@tannewt tannewt requested a review from kattni May 20, 2021 00:24
Copy link
Contributor

@kattni kattni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested successfully on MagTag and ItsyBitsy RP2040, with CircuitPython builds from adafruit/circuitpython#4743.

NeoPixels do not light up with previous versions of the NeoPixel library with that build of CircuitPython. Updated to the PR version, NeoPixels work successfully.

@kattni kattni merged commit a8e9975 into adafruit:master May 20, 2021
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request May 21, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel to 6.1.3 from 6.0.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_NeoPixel#111 from tannewt/auto_power
  > Added help text and problem matcher
  > Added pull request template
@anecdata
Copy link
Member

anecdata commented Aug 11, 2021

I wonder if there's another approach. We have a number of boards with power control of various peripherals, and in some cases, the power control pin also controls something else, e.g., MagTag NEOPIXEL_POWER_INVERTED also powers the analog light sensor.

Also in the NeoPixel case, currently a private variable is needed to turn off power once init'd (or deinit the neopixel) - easily fixed independent of the larger issue.

And we have other peripherals with power control pins where the power control remains separate, e.g., MagTag speaker.

FeatherS2 has Dotstar with a power control pin that also controls the 2° LDO 3v3.

I suspect as time goes on, the variations will increase, depending on the peripherals and low-power needs of the particular board.

It seems to me that power control is a feature of the board rather than of a specific peripheral, and board-specific libraries could certainly account for power control (or leave power control to the user if they are not using the standard board library).

@tannewt
Copy link
Member Author

tannewt commented Aug 11, 2021

I think we changed things here so that the power change would be backwards compatible. I think the simplest fix is to catch the pin in use exception and assume the user is doing it correctly when in use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants