ACT Blink
This commit is contained in:
parent
41ab6e4b1b
commit
8f2f5711ea
10
app.py
10
app.py
|
@ -66,11 +66,17 @@ def getRSSI():
|
||||||
|
|
||||||
# Blink the Pi led to allow identification
|
# Blink the Pi led to allow identification
|
||||||
def blinkPy():
|
def blinkPy():
|
||||||
|
# disable mmc access led
|
||||||
|
os.system('echo none | sudo tee /sys/class/leds/led0/trigger')
|
||||||
|
# Blink 10 times
|
||||||
for j in range(10):
|
for j in range(10):
|
||||||
os.system('echo 1 | sudo dd status=none of=/sys/class/leds/led0/brightness > /dev/null 2>&1') # led on
|
# TODO : add dd to NOPASSWD in /etc/sudoers.d/010...
|
||||||
|
os.system('echo 1 | sudo tee /sys/class/leds/led0/brightness') # led on
|
||||||
time.sleep(.2)
|
time.sleep(.2)
|
||||||
os.system('echo 0 | sudo dd status=none of=/sys/class/leds/led0/brightness > /dev/null 2>&1') # led off
|
os.system('echo 0 | sudo tee /sys/class/leds/led0/brightness') # led off
|
||||||
time.sleep(.2)
|
time.sleep(.2)
|
||||||
|
# restore default behavior
|
||||||
|
os.system('echo mmc0 | sudo tee /sys/class/leds/led0/trigger')
|
||||||
return "OK"
|
return "OK"
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue