maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Control LED in Python (https://talk.maemo.org/showthread.php?t=13545)

jgallen23 2007-12-21 01:01

Control LED in Python
 
Is there an api to control the led in the n810 with python?

Aisu 2007-12-21 01:16

Re: Control LED in Python
 
Sorry, don't know anyone attempting to do this on an IT, but this is the closest thing I could find .

Hope it helps!

jgallen23 2007-12-21 01:21

Re: Control LED in Python
 
that looks like its for a symbian device

Moonshine 2007-12-21 04:51

Re: Control LED in Python
 
I could be totally lost here, but shouldn't there be some dbus signals to control the leds that you could send via python?

Aisu 2007-12-22 02:57

Re: Control LED in Python
 
Hm, from the PyMaemo site, you should be able to learn from it and change around to what you need, I hope :):
Quote:

#!/usr/bin/python2.5

import osso
import gobject

# Example of using osso.DeviceState.display_state_on
# You need to set the display brightness period to 10 seconds.
# This example will bright the display after each 11 seconds.

count = 0

def blink_cb(device, loop):

global count

device.display_state_on()

count += 1
if count == 5:
loop.quit()
return False

return True

def main():
global count
loop = gobject.MainLoop()
osso_c = osso.Context("osso_test_device_on", "0.0.1", False)
device = osso.DeviceState(osso_c)

gobject.timeout_add(11000, blink_cb, device, loop)

loop.run()

if __name__ == "__main__":
main()

Informatic 2009-11-22 09:52

Re: Control LED in Python
 
I know that this thread is so old, but maybe someone will need this.
I wrote (and explained a bit) how you can manage LED with Python on N810 (i think that it also should work on N800)
Enjoy: http://blog.tastycode.pl/2009/11/21/...ets-in-python/ :)

Informatic - Happy N810 user/developer :)

qwerty12 2009-11-22 09:56

Re: Control LED in Python
 
/me swears by http://sse2.net/ledcolor.py

gerstavros 2009-11-29 17:23

Re: Control LED in Python
 
Quote:

Originally Posted by qwerty12 (Post 385918)

That īs a very usefull app! I was looking for something like this a long time. Can you improve it so that led doesnīt switch off after some seconds (if that 's possible), add more feutures like blinking, better ui and upload it to the repo?


All times are GMT. The time now is 14:38.

vBulletin® Version 3.8.8