kopia lustrzana https://github.com/blaz-r/pico_python_ws2812b
more light in the fireflies example
rodzic
d039dde5d4
commit
14b23efac4
|
@ -3,7 +3,7 @@ import ws2812b
|
||||||
import random
|
import random
|
||||||
|
|
||||||
bright_div = 20
|
bright_div = 20
|
||||||
numpix = 30 # Number of NeoPixels
|
numpix = 50 # Number of NeoPixels
|
||||||
# Pin where NeoPixels are connected
|
# Pin where NeoPixels are connected
|
||||||
strip = ws2812b.ws2812b(numpix, 0,0)
|
strip = ws2812b.ws2812b(numpix, 0,0)
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ colors = [
|
||||||
[200, 200, 20], # Yellow
|
[200, 200, 20], # Yellow
|
||||||
[30, 200, 200], # Blue
|
[30, 200, 200], # Blue
|
||||||
[150,50,10],
|
[150,50,10],
|
||||||
[50,200,0],
|
[50,200,10],
|
||||||
]
|
]
|
||||||
|
|
||||||
max_len=20
|
max_len=20
|
||||||
|
@ -20,7 +20,7 @@ min_len = 5
|
||||||
#pixelnum, posn in flash, flash_len, direction
|
#pixelnum, posn in flash, flash_len, direction
|
||||||
flashing = []
|
flashing = []
|
||||||
|
|
||||||
num_flashes = 5
|
num_flashes = 10
|
||||||
|
|
||||||
for i in range(num_flashes):
|
for i in range(num_flashes):
|
||||||
pix = random.randint(0, numpix - 1)
|
pix = random.randint(0, numpix - 1)
|
||||||
|
@ -49,6 +49,6 @@ while True:
|
||||||
flash_len = random.randint(min_len, max_len)
|
flash_len = random.randint(min_len, max_len)
|
||||||
flashing[i] = [pix, colors[col], flash_len, 0, 1]
|
flashing[i] = [pix, colors[col], flash_len, 0, 1]
|
||||||
flashing[i][3] = flashing[i][3] + flashing[i][4]
|
flashing[i][3] = flashing[i][3] + flashing[i][4]
|
||||||
time.sleep(0.007)
|
time.sleep(0.005)
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue