Skip to content

Commit cf66ddb

Browse files
authored
Merge pull request #76 from FoamyGuy/power_before_neopixel_init
initialize neopixel power pin before neopixels
2 parents e1e6a63 + b05328a commit cf66ddb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

adafruit_magtag/peripherals.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,15 @@ class Peripherals:
4242

4343
# pylint: disable=too-many-instance-attributes, too-many-locals, too-many-branches, too-many-statements
4444
def __init__(self):
45-
# Neopixels
46-
self.neopixels = neopixel.NeoPixel(board.NEOPIXEL, 4, brightness=0.3)
45+
# Neopixel power
4746
try:
4847
self._neopixel_disable = DigitalInOut(board.NEOPIXEL_POWER)
4948
self._neopixel_disable.direction = Direction.OUTPUT
5049
self._neopixel_disable.value = False
5150
except ValueError:
5251
self._neopixel_disable = None
52+
# Neopixels
53+
self.neopixels = neopixel.NeoPixel(board.NEOPIXEL, 4, brightness=0.3)
5354

5455
# Battery Voltage
5556
self._batt_monitor = AnalogIn(board.BATTERY)

0 commit comments

Comments
 (0)