File tree 2 files changed +10
-3
lines changed
2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 29
29
30
30
import gc
31
31
import time
32
+ import board
32
33
from adafruit_portalbase import PortalBase
33
34
from adafruit_magtag .network import Network
34
35
from adafruit_magtag .graphics import Graphics
@@ -75,6 +76,11 @@ def __init__(
75
76
debug = False ,
76
77
):
77
78
79
+ self .peripherals = Peripherals ()
80
+
81
+ if status_neopixel == board .NEOPIXEL :
82
+ status_neopixel = self .peripherals .neopixels
83
+
78
84
network = Network (
79
85
status_neopixel = status_neopixel ,
80
86
extract_values = False ,
@@ -99,8 +105,6 @@ def __init__(
99
105
debug = debug ,
100
106
)
101
107
102
- self .peripherals = Peripherals ()
103
-
104
108
gc .collect ()
105
109
106
110
def exit_and_deep_sleep (self , sleep_time ):
Original file line number Diff line number Diff line change @@ -55,7 +55,10 @@ def __init__(
55
55
debug = False ,
56
56
):
57
57
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 )
59
62
else :
60
63
status_led = None
61
64
super ().__init__ (
You can’t perform that action at this time.
0 commit comments