Created
April 28, 2023 19:21
-
-
Save 11Firefox11/6d0b6aa52ee21002a103aa7cbce1da1f to your computer and use it in GitHub Desktop.
Test your RGB LED strip with the LedController
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script is part of my blog post: https://tomoviktor.com/posts/pialarm-physical | |
from time import sleep | |
from led_controller import LedController | |
controller = LedController() | |
controller.red = 255 | |
color_sequence = [ | |
(255, 255, 0), | |
(0, 255, 0), | |
(0, 255, 255), | |
(0, 0, 255), | |
(255, 0, 255), | |
(255, 0, 0), | |
] | |
try: | |
while True: | |
for target_color in color_sequence: | |
for new_color in controller.transition(*target_color): | |
controller.red, controller.green, controller.blue = new_color | |
sleep(0.01) | |
except KeyboardInterrupt as e: | |
controller.reset() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This script is part of my blog post: How to Connect a LED Strip to a Raspberry Pi.