Skip to content

Commit

Permalink
add zero3w led's
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelscholle committed Apr 22, 2024
1 parent 23fc37a commit c411644
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions led_sys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,17 @@ if [ -d /sys/class/leds/openhd-x20dev ]; then
elif grep -q "Raspberry Pi" /proc/cpuinfo; then
PLATFORM="pi"
debugMessage "Platform: RPI"

if [ ! -d /sys/class/leds/PWR ]; then
COLOR="green"
debugMessage "Only One LED"
fi
elif [ ! -d /sys/class/leds/user-led/brightness ]; then
PLATFORM="cm3"
debugMessage "Only One LED"
debugMessage "Platform: CM3"

elif [ ! -d /sys/class/leds/board-led/brightness ]; then
PLATFORM="zero3w"
debugMessage "Platform: Zero3w"
fi

# Main functions
Expand Down Expand Up @@ -113,6 +116,8 @@ LED_ON() {
echo 1 > /sys/class/leds/pi-led-green/brightness
echo 1 > /sys/class/leds/pwr-led-red/brightness
fi
elif [ "$PLATFORM" == "zero3w" ]; then
echo 1 > /sys/class/leds/board-led/brightness
fi
}

Expand Down Expand Up @@ -177,6 +182,8 @@ LED_OFF() {
echo 0 > /sys/class/leds/pi-led-green/brightness
echo 0 > /sys/class/leds/pwr-led-red/brightness
fi
elif [ "$PLATFORM" == "zero3w" ]; then
echo 0 > /sys/class/leds/board-led/brightness
fi
}

Expand Down

0 comments on commit c411644

Please sign in to comment.