File tree Expand file tree Collapse file tree
CircuitPython_WeatherCloud Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import time
2+ import random
23import board
34import busio
4- import random
55from digitalio import DigitalInOut
66import neopixel
77from adafruit_esp32spi import adafruit_esp32spi
88from adafruit_esp32spi import adafruit_esp32spi_wifimanager
9- import adafruit_requests as requests
109import adafruit_fancyled .adafruit_fancyled as fancy
1110
1211print ("ESP32 Open Weather API demo" )
101100
102101 if raining :
103102 # 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
105104 pixels [random .randint (0 , len (pixels )- 1 )] = 0xFFFFFF # make a random pixel white
106105 pixels .show ()
107106
118117 time .sleep (random .uniform (0.01 , 0.3 )) # pause
119118 # pick next thunderbolt time now
120119 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