Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[Script] Lighthouse led script

OP broodplank1337

14th June 2014, 10:00 AM   |  #1  
broodplank1337's Avatar
OP Recognized Contributor / Recognized Developer
Flag Nijmegen
Thanks Meter: 10,102
 
4,943 posts
Join Date:Joined: Nov 2011
Donate to Me
More
Since this section is almost becoming a true fossil, buried somewhere in the Sahara dessert, I decide to share just another shell script I made which is for Android.

I call it the "lighthouse" script
Flashbang eye hurt script
, because basically what it does is looping the brightness value of your camera LED, up and down continuously. and it looks kinda like the effect that you get from a lighthouse.
It pulses the led on and off on chosen speed (defined by intervalValue and pauseValue).

IT can be used for example for using it as a way to signal people in an emergency or so
it is probably the best to use it to annoy your friends with it or check out the awesome effect of Tapetum lucidum, make sure to keep a fair distance


Be warned, it may really hurt your eyes and causes temporary blind spots in your vision very rapidly (on long term this will damage your eyes without question)

I am not responsible for any punches or bite marks that you received, nor the eye hurt you caused with this script



Instructions:
1. Copy script to PC and adjust values if needed
2. Push script to phone in an ext4 partition, for example "adb push lighthouse /system/bin/"
3. Set chmod 755 "adb shell chmod 755 /system/bin/lighthouse"
4. Open terminal emulator and type "lighthouse" to run the script
4. Open terminal emulator and type "lighthouse", don't press enter yet
5. Find a suitable target, human or animal with Tapetum lucidum eyes for example. Use script at night for full performance
6. Now run the script and profit (be sure to dodge the counter attack caused by target)




Script

Code:
#!/system/bin/sh

# Lighthouse script
# by broodplank

export max=`cat /sys/class/leds/torch-sec1/max_brightness`;
export intervalValue="0.03"
export pauseValue="0.5"

while [ 1 ]

trap '{ echo "Interrupted, resetting led"; echo 0 > /sys/class/leds/torch-sec1/brightness ; exit 1; }' INT

do

 for i in `seq 0 $max`;
  do
    echo $i > /sys/class/leds/torch-sec1/brightness
    sleep $intervalValue
  done

  sleep $pauseValue

 for o in `seq $max -1 0`;
  do
    echo $o > /sys/class/leds/torch-sec1/brightness
    sleep $intervalValue
  done

  sleep $pauseValue

done

Oh and believe me, you will regret you tested it on your self if you are in a dark room. true story

Use this script responsibly (if possible)

not sure if troll or real.. it is a script for developers, just has a nasty outcome
Last edited by broodplank1337; 14th June 2014 at 10:25 AM.
The Following 4 Users Say Thank You to broodplank1337 For This Useful Post: [ View ]
15th June 2014, 09:54 PM   |  #2  
elesbb's Avatar
Senior Member
Thanks Meter: 4,467
 
6,918 posts
Join Date:Joined: Jun 2010
Donate to Me
More
Quote:
Originally Posted by broodplank1337

Since this section is almost becoming a true fossil, buried somewhere in the Sahara dessert, I decide to share just another shell script I made which is for Android.

I call it the "lighthouse" script
Flashbang eye hurt script
, because basically what it does is looping the brightness value of your camera LED, up and down continuously. and it looks kinda like the effect that you get from a lighthouse.
It pulses the led on and off on chosen speed (defined by intervalValue and pauseValue).

IT can be used for example for using it as a way to signal people in an emergency or so
it is probably the best to use it to annoy your friends with it or check out the awesome effect of Tapetum lucidum, make sure to keep a fair distance


Be warned, it may really hurt your eyes and causes temporary blind spots in your vision very rapidly (on long term this will damage your eyes without question)

I am not responsible for any punches or bite marks that you received, nor the eye hurt you caused with this script



Instructions:
1. Copy script to PC and adjust values if needed
2. Push script to phone in an ext4 partition, for example "adb push lighthouse /system/bin/"
3. Set chmod 755 "adb shell chmod 755 /system/bin/lighthouse"
4. Open terminal emulator and type "lighthouse" to run the script
4. Open terminal emulator and type "lighthouse", don't press enter yet
5. Find a suitable target, human or animal with Tapetum lucidum eyes for example. Use script at night for full performance
6. Now run the script and profit (be sure to dodge the counter attack caused by target)




Script

Code:
#!/system/bin/sh

# Lighthouse script
# by broodplank

export max=`cat /sys/class/leds/torch-sec1/max_brightness`;
export intervalValue="0.03"
export pauseValue="0.5"

while [ 1 ]

trap '{ echo "Interrupted, resetting led"; echo 0 > /sys/class/leds/torch-sec1/brightness ; exit 1; }' INT

do

 for i in `seq 0 $max`;
  do
    echo $i > /sys/class/leds/torch-sec1/brightness
    sleep $intervalValue
  done

  sleep $pauseValue

 for o in `seq $max -1 0`;
  do
    echo $o > /sys/class/leds/torch-sec1/brightness
    sleep $intervalValue
  done

  sleep $pauseValue

done

Oh and believe me, you will regret you tested it on your self if you are in a dark room. true story

Use this script responsibly (if possible)

not sure if troll or real.. it is a script for developers, just has a nasty outcome

I used this, and a ship landed in my front yard
21st June 2014, 09:42 PM   |  #3  
broodplank1337's Avatar
OP Recognized Contributor / Recognized Developer
Flag Nijmegen
Thanks Meter: 10,102
 
4,943 posts
Join Date:Joined: Nov 2011
Donate to Me
More
Quote:
Originally Posted by elesbb

I used this, and a ship landed in my front yard

hahaha well I must say the script actually does provide a good signal light, which is also great to blind your mates with
22nd June 2014, 09:38 AM   |  #4  
Senior Member
Thanks Meter: 13
 
199 posts
Join Date:Joined: Sep 2013
i dont know what i am missing, but how do i push it to my phone,

edit, never mind i think i got it.
Last edited by Galaxy*$4; 22nd June 2014 at 10:10 AM.
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes