File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
CircuitPython_WeatherCloud Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change 1
1
import time
2
+ import random
2
3
import board
3
4
import busio
4
- import random
5
5
from digitalio import DigitalInOut
6
6
import neopixel
7
7
from adafruit_esp32spi import adafruit_esp32spi
8
8
from adafruit_esp32spi import adafruit_esp32spi_wifimanager
9
- import adafruit_requests as requests
10
9
import adafruit_fancyled .adafruit_fancyled as fancy
11
10
12
11
print ("ESP32 Open Weather API demo" )
101
100
102
101
if raining :
103
102
# don't have a droplet every time
104
- if ( random .randint (0 , 25 ) == 0 ) : # 1 out of 25 times
103
+ if random .randint (0 , 25 ) == 0 : # 1 out of 25 times
105
104
pixels [random .randint (0 , len (pixels )- 1 )] = 0xFFFFFF # make a random pixel white
106
105
pixels .show ()
107
106
118
117
time .sleep (random .uniform (0.01 , 0.3 )) # pause
119
118
# pick next thunderbolt time now
120
119
next_bolt_time = time .monotonic () + random .randint (5 , 15 ) # between 5 and 15 s
121
-
You can’t perform that action at this time.
0 commit comments