|
@ -23,21 +23,20 @@ if len(sys.argv)!=2: |
|
|
sys.exit(2) |
|
|
sys.exit(2) |
|
|
|
|
|
|
|
|
if sys.argv[1] == "on": |
|
|
if sys.argv[1] == "on": |
|
|
print("LED on") |
|
|
|
|
|
|
|
|
print("LED on \n") |
|
|
removeTrigger() |
|
|
removeTrigger() |
|
|
writeLED("/brightness", "1") |
|
|
writeLED("/brightness", "1") |
|
|
print("LED3 on") |
|
|
|
|
|
|
|
|
print("LED3 on \n") |
|
|
elif sys.argv[1] == "off": |
|
|
elif sys.argv[1] == "off": |
|
|
print("LED off") |
|
|
|
|
|
|
|
|
print("LED off \n") |
|
|
removeTrigger() |
|
|
removeTrigger() |
|
|
writeLED("/brightness", "0") |
|
|
writeLED("/brightness", "0") |
|
|
print("LED3 off") |
|
|
|
|
|
|
|
|
print("LED3 off \n") |
|
|
elif sys.argv[1] == "blink": |
|
|
elif sys.argv[1] == "blink": |
|
|
print("LED blinking") |
|
|
|
|
|
while True: |
|
|
|
|
|
writeLED("/trigger", "timer") |
|
|
|
|
|
writeLED("/delay_on", "50") |
|
|
|
|
|
writeLED("/delay_off", "50") |
|
|
|
|
|
|
|
|
print("LED blinking \n") |
|
|
|
|
|
writeLED("/trigger", "timer") |
|
|
|
|
|
writeLED("/delay_on", "500") |
|
|
|
|
|
writeLED("/delay_off", "500") |
|
|
else: |
|
|
else: |
|
|
print("Wrong command!!!") |
|
|
print("Wrong command!!!") |
|
|
|
|
|
|
|
|