Skip to content

Instantly share code, notes, and snippets.

@11Firefox11
Created April 28, 2023 19:21
Show Gist options
  • Save 11Firefox11/6d0b6aa52ee21002a103aa7cbce1da1f to your computer and use it in GitHub Desktop.
Save 11Firefox11/6d0b6aa52ee21002a103aa7cbce1da1f to your computer and use it in GitHub Desktop.
Test your RGB LED strip with the LedController
# 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()
@11Firefox11
Copy link
Author

This script is part of my blog post: How to Connect a LED Strip to a Raspberry Pi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment