slitaz-arm diff rpi/pileds @ rev 167

Mv ACT led on/off from tazberry to pileds
author Christophe Lincoln <pankso@slitaz.org>
date Sun May 04 19:17:48 2014 +0200 (2014-05-04)
parents 0eb0f35e2f0d
children f3a522138df4
line diff
     1.1 --- a/rpi/pileds	Sun May 04 19:10:58 2014 +0200
     1.2 +++ b/rpi/pileds	Sun May 04 19:17:48 2014 +0200
     1.3 @@ -9,14 +9,12 @@
     1.4  usage() {
     1.5  	cat << EOT
     1.6  
     1.7 -$(boldify "Usage:") $(basename $0) [ledtype] [--option]
     1.8 +$(boldify "Usage:") $(basename $0) [command]
     1.9  
    1.10 -$(boldify "Types:")
    1.11 +$(boldify "Commands:")
    1.12    act          Turn on/off the on board ACT green led
    1.13    7-clock      Adafruit 7-segment LED Backpack clock example
    1.14 -  ada-clean    Clean: Adafruit 7-segment or 8x8 Matrix
    1.15 -
    1.16 -$(boldify "Types:")    
    1.17 +  ada-clean    Clean: Adafruit 7-segment or 8x8 Matrix  
    1.18  
    1.19  EOT
    1.20  #8x8          Adafruit 8x8 LED Matrix Backpack example
    1.21 @@ -40,7 +38,13 @@
    1.22  
    1.23  case "$1" in
    1.24  
    1.25 -	act) ;;
    1.26 +	act)
    1.27 +		status="$(cat /sys/class/leds/led0/brightness)"
    1.28 +		if [ "$status" == 0 ]; then
    1.29 +			echo "1" > ${brightness}
    1.30 +		else
    1.31 +			echo "0" > ${brightness}
    1.32 +		fi ;;
    1.33  
    1.34  	7-clock) 
    1.35  		scripts="/usr/share/adafruit/LEDBackpack"