The Following User Says Thank You to pH5 For This Useful Post: | ||
|
2010-05-09
, 14:14
|
Posts: 8 |
Thanked: 14 times |
Joined on Apr 2010
@ UK
|
#52
|
|
2010-05-09
, 23:47
|
|
Posts: 315 |
Thanked: 71 times |
Joined on Oct 2008
@ €@$T Montreal Quebec Canada
|
#53
|
#!/usr/bin/env python ### proof of concept for the N810 LED control (ld5521) by jott import pygtk import hildon pygtk.require('2.0') import gtk class LEDColor: def set_color_callback(self, widget, data=None, value=None): self.set_color(self.sliders[0].get_level(), self.sliders[1].get_level(), self.sliders[2].get_level()) def set_color(self,r,g,b): self.set_mode("direct") value = "%X:%X:%X" % (r,g,b) FILE = open("/sys/devices/platform/i2c_omap.2/i2c-0/0-0032/color","w") FILE.write(value) FILE.close() def set_mode(self,mode): FILE = open("/sys/devices/platform/i2c_omap.2/i2c-0/0-0032/mode","w") FILE.write(mode) FILE.close() def delete_event(self, widget, event, data=None): return False def destroy(self, widget, data=None): self.set_mode("run") gtk.main_quit() def __init__(self): self.set_color(0,0,0) window = gtk.Window(gtk.WINDOW_TOPLEVEL) window.connect("delete_event", self.delete_event) window.connect("destroy", self.destroy) window.set_border_width(10) content = gtk.VBox() self.sliders = [] for i in range(0,3): slider = hildon.HVolumebar() adj = slider.get_adjustment() adj.set_all(0, 0, 255, 1, 10) content.pack_start(slider, True, True, 0) slider.set_property("has_mute",False) slider.show() self.sliders.append(slider) for i in range(0,3): self.sliders[i].connect("level_changed", self.set_color_callback, None) window.add(content) content.show() window.show() def main(self): gtk.main() if __name__ == "__main__": led = LEDColor() led.main()
The Following User Says Thank You to LABAUDIO For This Useful Post: | ||
|
2010-05-10
, 01:23
|
|
Posts: 149 |
Thanked: 18 times |
Joined on Dec 2009
@ Dallas
|
#54
|
|
2010-05-11
, 20:00
|
|
Posts: 138 |
Thanked: 375 times |
Joined on Aug 2009
@ Berlin
|
#55
|
What about three cycles that do not all overlap (or, equivalently, two engines, but one can change the colour of an engine)? It wouldn't permit everything, but it would allow my example.
Does anyone know if this will be put in Testing anytime soon or did the author decide not to fix bugs and leave it for others to mess with??
|
2010-05-11
, 20:19
|
Posts: 92 |
Thanked: 9 times |
Joined on Apr 2010
|
#56
|
|
2010-05-11
, 21:04
|
|
Posts: 315 |
Thanked: 71 times |
Joined on Oct 2008
@ €@$T Montreal Quebec Canada
|
#57
|
can anyone temme if it is possible to get the blueish white light like when you switch on your phone for your im or messages? i tried rgb together but it isnt like the light that you see when you press and hold the power button for switching on the device. and how do i led colour for when your phone is on standby, like when you lock you phone.
-Thanks !
PatternPowerOn=9;3;0;rgb;9d80400042ff02ffc000;9d800000
PatternCommunicationIM=30;1;0;b;9d80400002ff03ff02ff03ff71080000;9d800000 PatternCommunicationSMS=30;1;0;b;9d80400002ff03ff02ff03ff71080000;9d800000 PatternCommunicationEmail=30;1;0;b;9d80400002ff03ff02ff03ff71080000;9d800000 PatternCommonNotification=30;1;0;b;9d80400002ff03ff02ff03ff71080000;9d800000
|
2010-05-11
, 21:06
|
Posts: 47 |
Thanked: 21 times |
Joined on Jan 2010
|
#58
|
Using two colour engines is nice, but is there a technical reason that three is not possible? With three, it would be possible to effectively create any pattern by using a red, green and blue line.
For example, it is, as far as I can see, impossible to cycled through a rainbow of colours, but it could be done with three engines.
|
2010-05-11
, 21:16
|
Posts: 243 |
Thanked: 146 times |
Joined on Dec 2009
@ Knowhere
|
#59
|
It should be possible! if you manually change the pattern.ini you can make it look like a traffic light. So it should be possible! dont ask me how though...
|
2010-05-11
, 21:19
|
|
Posts: 315 |
Thanked: 71 times |
Joined on Oct 2008
@ €@$T Montreal Quebec Canada
|
#60
|
PatternError=0;5;0;r;9d8040007f007f0040ff7f007f000000;9d800000 PatternDeviceOn=254;0;0;rgb;9d804000422043207f100000;9d800000 PatternDeviceSoftOff=253;0;0;rg;9d804000423f433f7f100000;9d800000 PatternPowerOn=9;3;0;rgb;9d80400042ff02ffc000;9d800000 PatternPowerOff=10;3;0;rgb;9d80400001ff43ff7f007f00c000;9d800000 PatternCommunicationCall=30;1;0;b;9d80400002ff03ff02ff03ff71080000;9d800000 PatternCommunicationIM=30;1;0;b;9d80400002ff03ff02ff03ff71080000;9d800000 PatternCommunicationSMS=30;1;0;b;9d80400002ff03ff02ff03ff71080000;9d800000 PatternCommunicationEmail=30;1;0;b;9d80400002ff03ff02ff03ff71080000;9d800000 PatternCommonNotification=30;1;0;b;9d80400002ff03ff02ff03ff71080000;9d800000 PatternWebcamActive=20;1;0;r;9d80400004ffc0000000;9d800000 PatternBatteryCharging=50;4;0;rg;9d804000427f0d7f7f007f0042000000;9d800000 PatternBatteryFull=40;4;0;g;9d80407f0000;9d800000
0-255, 0 is highest, 255 is lowest.
Since currently only a single pattern at a time can be displayed, this is used to assign importance to the LED patterns. Although only a single LED pattern can be displayed at any time, multiple patterns may be active, the pattern with the highest priority being displayed.
A common example of this is where the n900 is on charge, the battery is full (starting PatternBatteryFull with a priority of 40), and an SMS message is received (PatternCommunicationSMS with a priority of 30). On receipt of the SMS, the LED begins to display the flashing blue led of an SMS. Once that SMS has been dismissed, the green LED of the full battery notification is again displayed.
PatternDeviceOn=254;0;0;rgb;9d804000422043207f100000;9d800000 PatternCommunicationIM=30;1;0;b;9d80400002ff03ff02ff03ff71080000;9d800000
PatternDeviceOn=29;0;0;rgb;9d804000422043207f100000;9d800000 PatternCommunicationIM=30;1;0;b;9d80400002ff03ff02ff03ff71080000;9d800000
The Following User Says Thank You to LABAUDIO For This Useful Post: | ||
On the N8x0, all three engines are available for the RGB LEDs.