Skip to content

Commit

Permalink
Merge pull request #116 from adafruit/anecdata-patch-1
Browse files Browse the repository at this point in the history
Allow NEOPIXEL_POWER* init outside of NeoPixel lib
  • Loading branch information
tannewt authored Aug 12, 2021
2 parents b2f21e6 + 65eefcc commit 0f4661c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions neopixel.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,11 @@ def __init__(
if not power:
power = getattr(board, "NEOPIXEL_POWER", None)
if power:
self._power = digitalio.DigitalInOut(power)
self._power.switch_to_output(value=polarity)
try:
self._power = digitalio.DigitalInOut(power)
self._power.switch_to_output(value=polarity)
except ValueError:
pass

super().__init__(
n, brightness=brightness, byteorder=pixel_order, auto_write=auto_write
Expand Down

0 comments on commit 0f4661c

Please sign in to comment.