Welcome! Log In Create A New Profile

Advanced

Custom LEDs control.

Posted by shaggyone 
Custom LEDs control.
August 11, 2013 03:07AM
Hello I have installed debian onto my goflex .net devise. It has one multicolor led used by the device. And it has 2 * 4 cyan leds, used by original firmware to display drive scanning process.

I'd like to display some of my custom activity, such as transmission leeching and seeding bitrates, using theese LEDs. But I dont know how to do it. Any points?
Re: Custom LEDs control.
August 11, 2013 10:11AM
I've solved it. Here is my code in python:

def set_led(indicator_name, indicator_number, brightness):
dev_name = '/sys/class/leds/status:white:%(indicator_name)s%(indicator_number)d/brightness' % \
{'indicator_name': indicator_name, 'indicator_number': indicator_number}
f = open(dev_name, mode='w')
f.write("%(brightness)d" % {'brightness': brightness})
f.close()
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: