Adafruit_Learning_System_Gu.../QT_Py_Acrylic_Lamp/code.py
Noe Ruiz 765ba45c42 code for qt py acrylic lamp
code for qt py acrylic lamp
2021-12-20 09:12:14 -05:00

37 lines
1 KiB
Python

# SPDX-FileCopyrightText: 2021 Ruiz Bros for Adafruit Industries
# SPDX-License-Identifier: MIT
"""
This example displays three chase animations in sequence.
"""
import board
import neopixel
from adafruit_led_animation.animation.chase import Chase
from adafruit_led_animation.sequence import AnimationSequence
from adafruit_led_animation.color import (
RED,
GREEN,
BLUE
)
# Update to match the pin connected to your NeoPixels
pixel_pin = board.D0
# Update to match the number of NeoPixels you have connected
pixel_num = 8
pixels = neopixel.NeoPixel(pixel_pin, pixel_num, brightness=0.8, auto_write=False)
RedChase = Chase(pixels, speed=0.4, color=RED, size=1, spacing=8, reverse=True)
GreenChase = Chase(pixels, speed=0.4, color=GREEN, size=1, spacing=8, reverse=True)
BlueChase = Chase(pixels, speed=0.4, color=BLUE, size=1, spacing=8, reverse=True)
animations = AnimationSequence(
RedChase,
GreenChase,
BlueChase,
advance_interval=4,
auto_clear=True,
)
while True:
animations.animate()