samedi 22 février 2014

[Tutorial][XL][Dev] Control LED illumination via Sysfs topic




Introduction :


As we all know our Sony Xperia L has an awesome illuminating led's but according to the API provided by Sony it an be only controlled via the Illumination API in a fixed way of fading. But after roaming in root folders i found the files responsible for controlling led's via sysfs.
Some Images : :

 












Note : All of the above things need the device to be rooted.

Controlling stuffs :
We have 3 LEDS to control : 1 Red 1 Blue 1 Green (RGB). We can use RGB to make desired colours, Video on this thing soon explaining possibilities of the use of LEDS.

To turn on :

For Blue :

Code:


echo 255 > /sys/class/leds/led:rgb_blue/brightness

For Green :

Code:


echo 255 > /sys/class/leds/led:rgb_green/brightness

For Red :

Code:


echo 255 > /sys/class/leds/led:rgb_red/brightness

To turn off :

For Blue :

Code:


echo 0 > /sys/class/leds/led:rgb_blue/brightness

For Green :

Code:


echo 0 > /sys/class/leds/led:rgb_green/brightness

For Red :

Code:


echo 0 > /sys/class/leds/led:rgb_red/brightness

Example : Colour change effect


Code:


echo 255 > /sys/class/leds/led:rgb_blue/brightness; sleep ; echo 255 > /sys/class/leds/led:rgb_green/brightness; sleep 1; echo 255 > /sys/class/leds/led:rgb_red/brightness; sleep 1;

Now we can have developers code it in a synchronized loop to enable multiple effects

Have fun playing it with guys.

Hit that little cute thanks button if the post helped you :D








Attached Thumbnails


Click image for larger version<br/><br/>Name:	IMG_2650.jpg<br/>Views:	N/A<br/>Size:	266.4 KB<br/>ID:	2594109
 

Click image for larger version<br/><br/>Name:	IMG_2651.jpg<br/>Views:	N/A<br/>Size:	266.3 KB<br/>ID:	2594112
 

Click image for larger version<br/><br/>Name:	IMG_2652.jpg<br/>Views:	N/A<br/>Size:	269.1 KB<br/>ID:	2594113
 

Click image for larger version<br/><br/>Name:	LEDS-Control.png<br/>Views:	N/A<br/>Size:	60.1 KB<br/>ID:	2594138
 
















Aucun commentaire:

Enregistrer un commentaire