File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change 19
19
# longitude
20
20
long = - 71.06
21
21
22
+ # neopixel setup
23
+ NUMPIXELS = 30 # number of neopixels
24
+ BRIGHTNESS = 0.5 # A number between 0.0 and 1.0, where 0.0 is off, and 1.0 is max.
25
+ PIN = board .A3 # This is the default pin on the NeoPixel Driver BFF.
26
+
27
+ pixels = neopixel .NeoPixel (PIN , NUMPIXELS , brightness = BRIGHTNESS , auto_write = False )
28
+
29
+ # turn on NeoPixels on boot to check wiring
30
+ pixels .fill ((255 , 125 , 0 ))
31
+ pixels .show ()
32
+
22
33
# API request to open-meteo
23
34
weather_url = "https://api.open-meteo.com/v1/forecast?"
24
35
# pass latitude and longitude
@@ -136,13 +147,6 @@ def sun_countdown(sun_event):
136
147
percent_red = 0
137
148
percent_yellow = 0
138
149
139
- # neopixel setup
140
- NUMPIXELS = 30 # number of neopixels
141
- BRIGHTNESS = 0.05 # A number between 0.0 and 1.0, where 0.0 is off, and 1.0 is max.
142
- PIN = board .A3 # This is the default pin on the NeoPixel Driver BFF.
143
-
144
- pixels = neopixel .NeoPixel (PIN , NUMPIXELS , brightness = BRIGHTNESS , auto_write = False )
145
-
146
150
print (total_until_set )
147
151
# check to see if the star fragment should be lit up on start-up
148
152
if total_until_set < 0 :
You can’t perform that action at this time.
0 commit comments