Welcome to the LED Controller System, designed to enhance your applications with vibrant LED lighting effects. This system enables you to control RGB LEDs connected to a Raspberry Pi, offering various animations like breathing, blinking, and fading to enrich user experiences.
- Main Feature: Controls RGB LEDs through the RGBLEDController class, allowing for dynamic lighting effects.
- Initialization: Requires GPIO pin configuration for the RGB LEDs.
- Functionalities:
- Animation configurations (fade speed, breath speed, blink times).
- Direct LED color setting and animation control (looping, activation, interruption).
- Server Integration: Utilizes the ServerThread class to listen for external commands, enabling dynamic control over LED animations.
Purpose: Displays console logs remotely, facilitating debugging and monitoring of the LED Controller system from any location.
Functionality: Sends commands to the LED server (led_server.py), allowing users to remotely control LED animations and settings.
- Ensure your Raspberry Pi is set up with RGB LEDs connected to the specified GPIO pins.
- Incorporate the led_server.py in your application to control LED animations based on your needs.
- Use minidisplay.py to monitor system logs remotely for easier troubleshooting and monitoring.
- Utilize client.py to send custom LED commands to the server, offering flexibility in controlling the LED effects dynamically.
-
start led_server.py to ensure listening to new LED effect Commands
python3 led_server.py
-
a) Set the color to green via keyboard input:
python3 client.py
- Type in "color 0 255 0" and hit enter
-
b) Set the color to green via a python skript:
import socket
def send_msg_to_LED(command):
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as client_socket:
client_socket.connect((LED_HOST, LED_PORT))
client_socket.sendall(command.encode('utf-8'))
LED_HOST = 'localhost'
LED_PORT = 12345
send_msg_to_LED("color 0 255 0")
- Use calming breathing effects during idle times for ambiance.
- Employ bright blinks to indicate key actions like photo capture or payment confirmation.
- Align LED color themes with your application or event branding for cohesive experiences.