Browse Source

LED blink subroutine changed

master
Gustavo Martinez 2 years ago
parent
commit
143ee4651a
1 changed files with 4 additions and 10 deletions
  1. +4
    -10
      led.py

+ 4
- 10
led.py View File

@ -1,6 +1,5 @@
#!/usr/bin/python #!/usr/bin/python
import sys #reconocer lo que hay en la terminal import sys #reconocer lo que hay en la terminal
import time
LED_PATH = "/sys/class/leds/beaglebone:green:usr3" LED_PATH = "/sys/class/leds/beaglebone:green:usr3"
def writeLED(fileName, value, path=LED_PATH): def writeLED(fileName, value, path=LED_PATH):
@ -18,10 +17,7 @@ def removeTrigger():
return return
print("Starting App") print("Starting App")
#removeTrigger()
#writeLED("/brightness", "1")
#print("LED3 on")
#print("Finish App")
if len(sys.argv)!=2: if len(sys.argv)!=2:
print("Incorrect number of arguments") print("Incorrect number of arguments")
sys.exit(2) sys.exit(2)
@ -39,11 +35,9 @@ elif sys.argv[1] == "off":
elif sys.argv[1] == "blink": elif sys.argv[1] == "blink":
print("LED blinking") print("LED blinking")
while True: while True:
removeTrigger()
writeLED("/brightness", "1")
time.sleep(0.5)
writeLED("/brightness", "0")
time.sleep(0.5)
writeLED("/trigger", "timer")
writeLED("/delay_on", "50")
writeLED("/delay_off", "50")
else: else:
print("Wrong command!!!") print("Wrong command!!!")


Loading…
Cancel
Save