File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 2929
3030import gc
3131import time
32+ import board
3233from adafruit_portalbase import PortalBase
3334from adafruit_magtag .network import Network
3435from adafruit_magtag .graphics import Graphics
@@ -75,6 +76,11 @@ def __init__(
7576 debug = False ,
7677 ):
7778
79+ self .peripherals = Peripherals ()
80+
81+ if status_neopixel == board .NEOPIXEL :
82+ status_neopixel = self .peripherals .neopixels
83+
7884 network = Network (
7985 status_neopixel = status_neopixel ,
8086 extract_values = False ,
@@ -99,8 +105,6 @@ def __init__(
99105 debug = debug ,
100106 )
101107
102- self .peripherals = Peripherals ()
103-
104108 gc .collect ()
105109
106110 def exit_and_deep_sleep (self , sleep_time ):
Original file line number Diff line number Diff line change @@ -55,7 +55,10 @@ def __init__(
5555 debug = False ,
5656 ):
5757 if status_neopixel :
58- status_led = neopixel .NeoPixel (status_neopixel , 1 , brightness = 0.2 )
58+ if isinstance (status_neopixel , neopixel .NeoPixel ):
59+ status_led = status_neopixel
60+ else :
61+ status_led = neopixel .NeoPixel (status_neopixel , 1 , brightness = 0.2 )
5962 else :
6063 status_led = None
6164 super ().__init__ (
You can’t perform that action at this time.
0 commit comments