]>
vault307.fbx.one Git - Sensory_Wall.git/blob - LEDstripbreathe.py
1 import machine
, neopixel
, time
2 np
=neopixel
.NeoPixel(machine
.Pin(0), 96)
10 for i
in range(0, 4 * 256, 8):
12 if (i
// 256) % 2 == 0:
15 val
= 255 - (i
& 0xff)
20 for i
in range(4 * n
):
24 np
[i
% n
] = (0, 128, 128)
26 np
[n
- 1 - (i
% n
)] = (0, 128, 128)
37 return(pos
*3,255-pos
*3,0)
40 return(255-pos
*3,0,pos
*3)
43 return(0,pos
*3,255-pos
*3)
46 global position
, brightness
49 hue
=int(i
*(255/np
.n
)+position
)%256
51 color
=tuple(int(val
*brightness
) for val
in color
)
52 np
[(i
+position
)%np
.n
]=color
54 position
=(position
+1)% np
.n
59 global position
, brightness
62 hue
=int(-i
*(255/np
.n
)-position
)%256
64 color
=tuple(int(val
*brightness
) for val
in color
)
65 np
[(i
-position
)%np
.n
]=color
67 position
=(position
+1)% np
.n
68 #print(position,"anti")