Created
October 4, 2022 11:54
-
-
Save ericek111/09031373b354895b884cf84218d90f30 to your computer and use it in GitHub Desktop.
Script for Galaxy S10e to overclock the flashlight LED
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mytmpfolder="/dev/myowntmp" # it seems there is no /tmp, so let's make our own -- /dev is on a tmpfs, it is purged on reboot | |
mkdir -p "$mytmpfolder" | |
flashfile="/sys/class/camera/flash/rear_flash" | |
curval="$(cat "$mytmpfolder/turboflashval")" | |
curval="${curval:-0}" | |
HIGH_VAL=200 | |
LOW_VAL=2003 | |
function setFlash { | |
echo "$1" > "$flashfile" | |
echo "$1" > "$mytmpfolder/turboflashval" | |
echo "Setting $1" | |
} | |
if [ "$1" = "t" ]; then | |
if ( [ "$curval" -eq $LOW_VAL ] || [ "$curval" -eq 0 ] ); then | |
setFlash $HIGH_VAL | |
elif [ "$curval" -eq $HIGH_VAL ]; then | |
setFlash 0 | |
fi | |
else | |
if [ "$curval" -ne 0 ]; then | |
setFlash 0 | |
else | |
setFlash $LOW_VAL | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment