You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1022 B

2 years ago
2 years ago
2 years ago
2 years ago
  1. #!/bin/bash
  2. LED3_PATH=/sys/class/leds/beaglebone:green:usr3
  3. function removeTrigger
  4. {
  5. echo "none" >> "$LED3_PATH/trigger"
  6. }
  7. echo "The LED3 user is starting"
  8. if [ "$1" == "on" ]; then
  9. echo "LED on"
  10. removeTrigger
  11. echo "1" >> "$LED3_PATH/brightness"
  12. elif [ "$1" == "off" ]; then
  13. echo "LED off"
  14. removeTrigger
  15. echo "0" >> "$LED3_PATH/brightness"
  16. elif [ "$1" == "blink" ]; then
  17. "LED blinking"
  18. removeTrigger
  19. echo "1" >> "$LED3_PATH/brightness"
  20. sleep 0.5
  21. echo "0" >> "$LED3_PATH/brightness"
  22. sleep 0.5
  23. elif [ "$1" == "help" ]; then
  24. echo "This is an application to control User LED 3"
  25. echo "List of commands: "
  26. echo "on - Powers on the LED"
  27. echo "off - Powers off the LED"
  28. echo "blink - Makes the LED blink"
  29. else
  30. echo "Error: This is not a command for this application"
  31. echo "These are the commands you can use: "
  32. echo "on - Powers on the LED"
  33. echo "off - Powers off the LED"
  34. echo "blink - Makes the LED blink"
  35. fi
  36. echo "Done"