Skip to content

Instantly share code, notes, and snippets.

@agmm
Created September 9, 2023 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agmm/1c7fa347a8850b9791159307e3c469cc to your computer and use it in GitHub Desktop.
Save agmm/1c7fa347a8850b9791159307e3c469cc to your computer and use it in GitHub Desktop.
Script to control the onboard LEDs of the Raspberry Pi
#!/bin/bash
# Usage: leds <state>, where state can be 0 or 1
sudo sh -c "echo $1 > /sys/class/leds/PWR/brightness"
sudo sh -c "echo $1 > /sys/class/leds/ACT/brightness"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment