Go Back   Android Forums > Android Phones > HTC Droid Incredible > Incredible - All Things Root
Incredible - All Things Root Rooting, ROMS, Overclocking, etc.

Get excited for the Samsung Galaxy S5! Find everything you need and discuss it in our Galaxy S5 Forum!

test: Reply
 
LinkBack Thread Tools
Old June 17th, 2010, 01:57 AM   #1 (permalink)
Senior Member
Thread Author (OP)
 
Lars's Avatar
 
Join Date: Mar 2010
Posts: 1,395
 
Device(s): A whole drawer full.
Carrier: Verizon (usually)

Thanks: 70
Thanked 204 Times in 149 Posts
Cool Turn the Camera Flash LED on and off!!

If you have root here is a way to turn the Camera LED on and off for a real flashlight app. No working widget but it is based on the Desire hardware exploit from Damunix which I've adapted for the Incredible. I'm using superuser.apk but I think the unregulated su sticky method should work too.

Install Gscript from the market, or a terminal app if you are a glutton for typing punishment every time.
In Gscript select Menu - Add Script
Name: LED On
Needs SU checked and obviously Gscript has to be granted SU.
Body: echo 125 > /sys/devices/platform/flashlight.0/leds/flashlight/brightness
Save it off and select Menu - Add Script again
Name: LED Off
Needs SU checked
Body: echo 0 > /sys/devices/platform/flashlight.0/leds/flashlight/brightness
Save that one off

Run LED On to turn it on and LED Off, well you get it. Now we just need a stand alone app that runs in SU to clean it up. In any case this is much better than the $1 app in the Market that crashes the camera and requires a reboot.

Lars is offline  
Reply With Quote
The Following 5 Users Say Thank You to Lars For This Useful Post:
corywf (June 17th, 2010), dgourd (June 17th, 2010), killadanny (June 17th, 2010), paimon.soror (June 17th, 2010), Taylored (June 17th, 2010)
sponsored links
Old June 17th, 2010, 02:04 AM   #2 (permalink)
Senior Member
Thread Author (OP)
 
Lars's Avatar
 
Join Date: Mar 2010
Posts: 1,395
 
Device(s): A whole drawer full.
Carrier: Verizon (usually)

Thanks: 70
Thanked 204 Times in 149 Posts
Default

Hmm seems Lamppu works too. I thought I'd done something cool. Back to my hole...
Lars is offline  
Reply With Quote
Old June 17th, 2010, 07:18 AM   #3 (permalink)
Junior Member
 
Join Date: May 2010
Posts: 17
 
Device(s):
Carrier: Not Provided

Thanks: 5
Thanked 0 Times in 0 Posts
Default

Lampuu does work but crashes the camera. The script works well!
corywf is offline  
Reply With Quote
Old June 17th, 2010, 07:27 AM   #4 (permalink)
Member
 
paimon.soror's Avatar
 
Join Date: Apr 2010
Location: Vernon, CT
Posts: 413
 
Device(s): HTC Incredible
Carrier: Not Provided

Thanks: 16
Thanked 77 Times in 47 Posts
Default

Quote:
Originally Posted by Lars View Post
If you have root here is a way to turn the Camera LED on and off for a real flashlight app. No working widget but it is based on the Desire hardware exploit from Damunix which I've adapted for the Incredible. I'm using superuser.apk but I think the unregulated su sticky method should work too.

Install Gscript from the market, or a terminal app if you are a glutton for typing punishment every time.
In Gscript select Menu - Add Script
Name: LED On
Needs SU checked and obviously Gscript has to be granted SU.
Body: echo 125 > /sys/devices/platform/flashlight.0/leds/flashlight/brightness
Save it off and select Menu - Add Script again
Name: LED Off
Needs SU checked
Body: echo 0 > /sys/devices/platform/flashlight.0/leds/flashlight/brightness
Save that one off

Run LED On to turn it on and LED Off, well you get it. Now we just need a stand alone app that runs in SU to clean it up. In any case this is much better than the $1 app in the Market that crashes the camera and requires a reboot.
Nice work man! Having options is always great so even though there are other apps on the market that may or may not do the same, dont shy away from making scripts like you did above. Some people may find your script better, or maybe it will work better on their device vs other apps out there.

Good work!
__________________
Phone: HTC Incredible (Root)
.......... PhantomSkinz Screen Protector
.......... Seidio Extended Battery 1750mah
.......... Seidio Innocase
paimon.soror is offline  
Reply With Quote
Old June 17th, 2010, 10:24 AM   #5 (permalink)
Senior Member
 
yojoe600's Avatar
 
Join Date: Apr 2010
Location: NC
Posts: 2,188
 
Device(s): HTC Incredible(rooted) is incredible... but my omnia(sold) will be missed.
Carrier: Not Provided

Thanks: 141
Thanked 209 Times in 176 Posts
Default

nice work man... and yea lampuu works but at least u found another way
yojoe600 is offline  
Reply With Quote
Old June 17th, 2010, 02:16 PM   #6 (permalink)
Junior Member
 
Join Date: Apr 2010
Posts: 17
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 23 Times in 2 Posts
Default

Holy crap... put 255 in and look at it.. I'm still seeing little white dots...
snowzach is offline  
Reply With Quote
Old June 17th, 2010, 02:17 PM   #7 (permalink)
Junior Member
 
Join Date: Apr 2010
Posts: 17
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 23 Times in 2 Posts
Default

Looks like 128 is as bright as you can go without it shutting off automatically.. (ie working like a flash)
snowzach is offline  
Reply With Quote
Old June 17th, 2010, 03:18 PM   #8 (permalink)
Senior Member
 
Taylored's Avatar
 
Join Date: May 2010
Location: GA
Posts: 691
 
Device(s): Nexus 4, Galaxy S iii, Nexus 7, Incredible1(retired), Incredible2(retired), Galaxy Tab 7inch(retire
Carrier: Not Provided

Thanks: 74
Thanked 60 Times in 40 Posts
bradshaw.andre
Default

Awesome! Thanks!
Taylored is offline  
Reply With Quote
Old June 17th, 2010, 03:48 PM   #9 (permalink)
Junior Member
 
Join Date: May 2010
Posts: 39
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 3 Times in 3 Posts
Default Re: Turn the Camera Flash LED on and off!!

This is amaazziiing! I wish I could run 255 continuosly. Any tricks?
andreyua is offline  
Reply With Quote
Old June 17th, 2010, 04:07 PM   #10 (permalink)
Member
 
Join Date: Apr 2010
Posts: 266
 
Device(s): Galaxy Nexus, Droid RAZR MAXX, Droid Incredible
Carrier: Not Provided

Thanks: 57
Thanked 26 Times in 20 Posts
Default

Anyone who's tried this script, does it allow the light to stay on while video recording or does it crash?
Lefort1 is offline  
Reply With Quote
sponsored links
Old June 17th, 2010, 04:35 PM   #11 (permalink)
Senior Member
 
Taylored's Avatar
 
Join Date: May 2010
Location: GA
Posts: 691
 
Device(s): Nexus 4, Galaxy S iii, Nexus 7, Incredible1(retired), Incredible2(retired), Galaxy Tab 7inch(retire
Carrier: Not Provided

Thanks: 74
Thanked 60 Times in 40 Posts
bradshaw.andre
Default

Quote:
Originally Posted by Lefort1 View Post
Anyone who's tried this script, does it allow the light to stay on while video recording or does it crash?
Not working for me.
Taylored is offline  
Reply With Quote
Old June 17th, 2010, 05:50 PM   #12 (permalink)
New Member
 
Join Date: May 2010
Posts: 4
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

Echo not found errors for me... verified that I didn't mistype and su access is granted.
duradrinx is offline  
Reply With Quote
Old June 17th, 2010, 06:04 PM   #13 (permalink)
Junior Member
 
Join Date: May 2010
Posts: 39
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 3 Times in 3 Posts
Default Re: Turn the Camera Flash LED on and off!!

Guys,

Make sure you are using gscript and you allowed its SU priceledges. Oh and you obviously need root.
andreyua is offline  
Reply With Quote
Old June 17th, 2010, 08:17 PM   #14 (permalink)
Senior Member
Thread Author (OP)
 
Lars's Avatar
 
Join Date: Mar 2010
Posts: 1,395
 
Device(s): A whole drawer full.
Carrier: Verizon (usually)

Thanks: 70
Thanked 204 Times in 149 Posts
Default

Quote:
Originally Posted by duradrinx View Post
Echo not found errors for me... verified that I didn't mistype and su access is granted.
echo may need to be in lower case. Linux is a case sensitive OS.

Lamppu doesn't seem to crash my camera but I'll keep trying (to crash it ) Yea 255 tells it just to flash. Lamppu is able to sustain the brighter mode. Maybe that's what crashes the camera after a bit?

Thanks for the props BTW.
Lars is offline  
Reply With Quote
Old June 17th, 2010, 08:35 PM   #15 (permalink)
Senior Member
 
killadanny's Avatar
 
Join Date: Apr 2010
Posts: 847
 
Device(s): H.T.C. Droid Incredible
Carrier: Not Provided

Thanks: 37
Thanked 102 Times in 74 Posts
Default

Thanks, worked perfectly.
killadanny is offline  
Reply With Quote
Old June 17th, 2010, 08:45 PM   #16 (permalink)
New Member
 
Join Date: Jun 2010
Posts: 7
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

lamppu does not use the brighter one, i wrote a small script to loop the "255" command, it works, and also works while using the camera. however, it flickers a bit, but the main problem is that the LEDs get VERY HOT when left on 255. also i cant figure out how to turn it off short of restarting the phone.
Dr_Freeman is offline  
Reply With Quote
Old June 18th, 2010, 08:20 AM   #17 (permalink)
Senior Member
 
Taylored's Avatar
 
Join Date: May 2010
Location: GA
Posts: 691
 
Device(s): Nexus 4, Galaxy S iii, Nexus 7, Incredible1(retired), Incredible2(retired), Galaxy Tab 7inch(retire
Carrier: Not Provided

Thanks: 74
Thanked 60 Times in 40 Posts
bradshaw.andre
Default

Quote:
Originally Posted by Dr_Freeman View Post
lamppu does not use the brighter one, i wrote a small script to loop the "255" command, it works, and also works while using the camera. however, it flickers a bit, but the main problem is that the LEDs get VERY HOT when left on 255. also i cant figure out how to turn it off short of restarting the phone.
I'd like to test out that loop on my phone. Would you mind posting the script or sending a PM?

Thanks
Taylored is offline  
Reply With Quote
Old June 18th, 2010, 12:44 PM   #18 (permalink)
Member
 
paimon.soror's Avatar
 
Join Date: Apr 2010
Location: Vernon, CT
Posts: 413
 
Device(s): HTC Incredible
Carrier: Not Provided

Thanks: 16
Thanked 77 Times in 47 Posts
Default

Quote:
Originally Posted by Dr_Freeman View Post
lamppu does not use the brighter one, i wrote a small script to loop the "255" command, it works, and also works while using the camera. however, it flickers a bit, but the main problem is that the LEDs get VERY HOT when left on 255. also i cant figure out how to turn it off short of restarting the phone.
Yikes, LED's generally shouldn't get very hot...if they are that means there is far too much voltage flowing into the diode. If running 255 makes the LED hot, chances are you want to not use that value or you may kill the diode
paimon.soror is offline  
Reply With Quote
Old June 18th, 2010, 02:46 PM   #19 (permalink)
New Member
 
Join Date: Jun 2010
Posts: 7
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

sure, heres the script. USE AT YOUR OWN RISK.

Code:
while true; do
  out=`echo 255 > /sys/devices/platform/flashlight.0/leds/flashlight/brightness`
  done

this does continue to loop while the camera is on, but i wouldnt recommend it.
Dr_Freeman is offline  
Reply With Quote
Old June 18th, 2010, 03:27 PM   #20 (permalink)
Member
 
paimon.soror's Avatar
 
Join Date: Apr 2010
Location: Vernon, CT
Posts: 413
 
Device(s): HTC Incredible
Carrier: Not Provided

Thanks: 16
Thanked 77 Times in 47 Posts
Default

Quote:
Originally Posted by Dr_Freeman View Post
sure, heres the script. USE AT YOUR OWN RISK.

Code:
while true; do
  out=`echo 255 > /sys/devices/platform/flashlight.0/leds/flashlight/brightness`
  done

this does continue to loop while the camera is on, but i wouldnt recommend it.
Probably uses a significant amount of cpu time too to constantly write out 0xFF to that port lol, not to mention no "nice" way to end the script
paimon.soror is offline  
Reply With Quote
sponsored links
Reply


Go Back   Android Forums > Android Phones > HTC Droid Incredible > Incredible - All Things Root
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 11:18 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.