Update main.py

master
Ebbe Baß 2021-11-09 19:57:38 +01:00
parent f0f4782055
commit f2b8ea7efa
1 changed files with 5 additions and 2 deletions

View File

@ -15,6 +15,8 @@ LED_INVERT = False # True to invert the signal (when using NPN transistor
LED_CHANNEL = 0 # set to '1' for GPIOs 13, 19, 41, 45 or 53
global led_power
global led_power_toggler
led_power_toggler = True
led_power = True
try:
@ -85,9 +87,9 @@ def change_idle_mode(channel):
def power_toggle(channel):
if led_power == True:
return False
led_power_toggler = False
else:
return True
led_power_toggler = True
if __name__ == '__main__':
strip = Adafruit_NeoPixel(LED_COUNT, LED_PIN, LED_FREQ_HZ, LED_DMA, LED_INVERT, LED_BRIGHTNESS, LED_CHANNEL)
@ -100,6 +102,7 @@ if __name__ == '__main__':
try:
while True:
led_power = led_power_toggler
try:
with open('./idle.txt', 'r') as f:
idle_mode = f.readline()