From 4c9ffd60617f176ec5fb63fc760d592a299394cf Mon Sep 17 00:00:00 2001 From: Gustavo Martinez Date: Wed, 11 May 2022 17:24:21 -0500 Subject: [PATCH] First commit --- blink_LED3.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 blink_LED3.sh diff --git a/blink_LED3.sh b/blink_LED3.sh new file mode 100644 index 0000000..af1826e --- /dev/null +++ b/blink_LED3.sh @@ -0,0 +1,23 @@ +#!/bin/bash +LED3_PATH=/sys/class/leds/beaglebone:green:usr3 + +function removeTrigger +{ + echo "none" >> "$LED3_PATH/trigger" +} + +echo "The LED3 user is starting" + if [ "$1" == "on" ]; then + removeTrigger + echo "1" >> "$LED3_PATH/brightness" + elif [ "$1" == "off" ]; then + removeTrigger + echo "0" >> "$LED3_PATH/brightness" + elif [ "$1" == "blink" ]; then + removeTrigger + echo "1" >> "$LED3_PATH/brightness" + sleep 0.5 + echo "0" >> "$LED3_PATH/brightness" + sleep 0.5 + fi + echo "Done"