]>
vault307.fbx.one Git - Sensory_Wall.git/blob - circuitPython/test2.py
1 # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2 # SPDX-FileCopyrightText: 2023 Neradoc https://neradoc.me
3 # SPDX-License-Identifier: MIT
5 This example repeatedly displays all available animations
6 on the IS31FL3741 13x9 RGB Matrix, at a five second interval.
9 from adafruit_led_animation
.animation
.blink
import Blink
10 from adafruit_led_animation
.animation
.sparklepulse
import SparklePulse
11 from adafruit_led_animation
.animation
.comet
import Comet
12 from adafruit_led_animation
.animation
.chase
import Chase
13 from adafruit_led_animation
.animation
.pulse
import Pulse
14 from adafruit_led_animation
.animation
.sparkle
import Sparkle
15 from adafruit_led_animation
.animation
.rainbowchase
import RainbowChase
16 from adafruit_led_animation
.animation
.rainbowsparkle
import RainbowSparkle
17 from adafruit_led_animation
.animation
.rainbowcomet
import RainbowComet
18 from adafruit_led_animation
.animation
.solid
import Solid
19 from adafruit_led_animation
.animation
.colorcycle
import ColorCycle
20 from adafruit_led_animation
.animation
.rainbow
import Rainbow
21 from adafruit_led_animation
.animation
.customcolorchase
import CustomColorChase
22 from adafruit_led_animation
.sequence
import AnimationSequence
23 from adafruit_led_animation
.color
import PURPLE
, WHITE
, AMBER
, JADE
, MAGENTA
, ORANGE
24 from adafruit_is31fl3741
import PREFER_BUFFER
25 from adafruit_is31fl3741
.adafruit_rgbmatrixqt
import Adafruit_RGBMatrixQT
26 from adafruit_is31fl3741
.is31fl3741_pixelbuf
import IS31FL3741_PixelBuf
29 i2c
= board
.STEMMA_I2C()
31 ########################################################################
32 # Instantiate the nice IS31FL3741
33 ########################################################################
35 is31
= Adafruit_RGBMatrixQT(i2c
, allocate
=PREFER_BUFFER
)
36 is31
.set_led_scaling(0xFF)
37 is31
.global_current
= 0xFF
40 ########################################################################
41 # Setup the mapping and PixelBuf instance
42 ########################################################################
49 for y
in range(HEIGHT
)
51 for address
in Adafruit_RGBMatrixQT
.pixel_addrs(x
, y
)
54 pixels
= IS31FL3741_PixelBuf(is31
, LEDS_MAP
, init
=False, auto_write
=False)
56 ########################################################################
58 ########################################################################
60 blink
= Blink(pixels
, speed
=0.5, color
=JADE
)
61 colorcycle
= ColorCycle(pixels
, speed
=0.4, colors
=[MAGENTA
, ORANGE
])
62 comet
= Comet(pixels
, speed
=0.01, color
=PURPLE
, tail_length
=10, bounce
=True)
63 chase
= Chase(pixels
, speed
=0.1, size
=3, spacing
=6, color
=WHITE
)
64 pulse
= Pulse(pixels
, speed
=0.1, period
=3, color
=AMBER
)
65 sparkle
= Sparkle(pixels
, speed
=0.1, color
=PURPLE
, num_sparkles
=10)
66 solid
= Solid(pixels
, color
=JADE
)
67 rainbow
= Rainbow(pixels
, speed
=0.1, period
=2)
68 sparkle_pulse
= SparklePulse(pixels
, speed
=0.1, period
=3, color
=JADE
)
69 rainbow_comet
= RainbowComet(pixels
, speed
=0.1, tail_length
=7, bounce
=True)
70 rainbow_chase
= RainbowChase(pixels
, speed
=0.1, size
=3, spacing
=2, step
=8)
71 rainbow_sparkle
= RainbowSparkle(pixels
, speed
=0.1, num_sparkles
=15)
72 custom_color_chase
= CustomColorChase(
73 pixels
, speed
=0.1, size
=2, spacing
=3, colors
=[ORANGE
, WHITE
, JADE
]
76 animations
= AnimationSequence(