Browse Source

On ok

master
parent
commit
96eae64097
2 changed files with 21 additions and 2 deletions
  1. +11
    -0
      Readme.md
  2. +10
    -2
      bashLED.sh

+ 11
- 0
Readme.md View File

@ -0,0 +1,11 @@
Readme
This project is a Bash script to modify the user3 LED status by using the command `bashLED` and
passing an argument `on`, `off`, `blink`, or `status`.
The `status` argument will send back the current status and will not modify it.
Gerardo Marx Chavez-Campos
13/04/2021
Mobile-Devices

+ 10
- 2
bashLED.sh View File

@ -4,12 +4,20 @@ LED3_PATH=/sys/class/leds/beaglebone:green:usr3
function removeTrigger
{
echo 'none' >> '$LED3_PATH/trigger'
echo "none" >> "$LED3_PATH/trigger"
}
echo "Starting the LED Bash Script"
if [ $# != 1 ]; then
echo "Error: There is an incorrect number of arguments."
echo "Error: There is an incorrect number of arguments. Try:"
echo -e "\nbashLED [argument]\n\nwhere command is:"
echo -e "on, off, blink or status\n\ne.g. bashLED on"
exit 2
fi
echo "The argument passed is: $1"
if [ "$1" == "on" ]; then
echo "LED on"
removeTrigger
echo "1" >> "$LED3_PATH/brightness"
fi

Loading…
Cancel
Save