]>
vault307.fbx.one Git - m5Atom.git/blob - rainbowm5.py
1 from machine
import Pin
2 from neopixel
import NeoPixel
5 # Definitions for the ATOM Matrix
7 matrix_size_x
= const(5)
8 matrix_size_y
= const(5)
11 np
= NeoPixel(Pin(LED_GPIO
), matrix_size_x
* matrix_size_y
)
14 if pos
< 0 or pos
> 255:
17 return (255 - pos
* 3, pos
* 3, 0)
20 return (0, 255 - pos
* 3, pos
* 3)
22 return (pos
* 3, 0, 255 - pos
* 3)
24 def rainbow_cycle(wait
):
27 rc_index
= (i
* 256 // n
) + j
28 np
.fill(wheel(rc_index
& 255))