Update main.py
parent
36a1f39928
commit
7c3e0b3db1
5
main.py
5
main.py
|
@ -72,14 +72,19 @@ def led_power_toggle():
|
||||||
led_power = False
|
led_power = False
|
||||||
else:
|
else:
|
||||||
led_power = True
|
led_power = True
|
||||||
|
print('Led toggled: '+led_power)
|
||||||
|
|
||||||
def read_idle():
|
def read_idle():
|
||||||
with open('./idle.txt', 'r') as f:
|
with open('./idle.txt', 'r') as f:
|
||||||
idle_mode = f.readline()
|
idle_mode = f.readline()
|
||||||
|
|
||||||
def change_idle_mode():
|
def change_idle_mode():
|
||||||
|
global idle_mode
|
||||||
with open('./idle.txt', 'w') as f:
|
with open('./idle.txt', 'w') as f:
|
||||||
f.write(int(idle_mode) + 1)
|
f.write(int(idle_mode) + 1)
|
||||||
|
with open('./idle.txt', 'r') as f:
|
||||||
|
idle_mode = f.readline()
|
||||||
|
print('Change Idle-Mode: '+idle_mode)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
strip = Adafruit_NeoPixel(LED_COUNT, LED_PIN, LED_FREQ_HZ, LED_DMA, LED_INVERT, LED_BRIGHTNESS, LED_CHANNEL)
|
strip = Adafruit_NeoPixel(LED_COUNT, LED_PIN, LED_FREQ_HZ, LED_DMA, LED_INVERT, LED_BRIGHTNESS, LED_CHANNEL)
|
||||||
|
|
Loading…
Reference in New Issue