uno-q-modulino-rgb-feedback.py

Arduino UNO Q SBC Controller Bundle · File : uno-q-modulino-rgb-feedback.py · Language : python · Use case : Contrôler les pixels Modulino pour fournir un retour visuel dynamique basé sur l'état du système Linux.

Python example demonstrating how to control the RGB LEDs of the Modulino Pixel node to create status animations.

Connect the Modulino Pixel node to the Q-Bus. Install the Python SDK for UNO Q via pip or App Lab. The script uses a loop to change colors. Adapt the I2C/Q-Bus addresses if multiple nodes are connected.

uno-q-modulino-rgb-feedback.py

#!/usr/bin/env python3
import time
import sys

# Simulation d'une interface avec le bus Q-Bus via les drivers Arduino App Lab
# En production, utilisez les bindings Python officiels du SDK UNO Q
try:
    from arduino_uno_q import ModulinoPixel
except ImportError:
    print("Erreur: SDK Arduino UNO Q non trouvé. Installez les bindings Python.")
    sys.exit(1)

def main():
    # Initialisation du nœud Pixel (adresse Q-Bus typique)
    pixel = ModulinoPixel(address=0x10)
    
    try:
        while True:
            # Cycle de couleurs pour tester le matériel
            pixel.set_color(255, 0, 0)   # Rouge
            pixel.update()
            time.sleep(0.5)
            
            pixel.set_color(0, 255, 0)   # Vert
            pixel.update()
            time.sleep(0.5)
            
            pixel.set_color(0, 0, 255)   # Bleu
            pixel.update()
            time.sleep(0.5)
            
    except KeyboardInterrupt:
        print("\nArrêt du script.")
        pixel.turn_off()
        pixel.update()

if __name__ == '__main__':
    main()

← Back to the board