adding in custom lighting effect

This commit is contained in:
talksik
2023-04-22 15:38:03 -07:00
parent e2c9b08c80
commit 397a3dffb8
2 changed files with 29 additions and 0 deletions
Vendored
BIN
View File
Binary file not shown.
@@ -0,0 +1,29 @@
#!/usr/bin/env python3
########################################################################
# Filename : LightWater.py
# Description : Use LEDBar Graph(10 LED)
# Author : www.freenove.com
# modification: 2019/12/27
########################################################################
from gpiozero import LEDBoard
from time import sleep
print('Program is starting ... ')
ledPins = ["J8:11", "J8:12","J8:13","J8:15","J8:16","J8:18","J8:22","J8:3","J8:5","J8:24"]
leds = LEDBoard(*ledPins, active_high=False)
timeDelay = 0.5
while True:
for index in range(0,len(ledPins),1): #move led(on) from left to right
leds.on(index)
sleep(timeDelay)
leds.off(index)
for index in range(len(ledPins)-1,-1,-1): #move led(on) from right to left
leds.on(index)
sleep(timeDelay)
leds.off(index)