maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N810 (https://talk.maemo.org/forumdisplay.php?f=28)
-   -   Python and the LEDs on the n810 (https://talk.maemo.org/showthread.php?t=17024)

rtrudel 2008-02-22 14:00

Python and the LEDs on the n810
 
I did a quick search and didn't see anything useful. Anyone know how to light the LEDs from Python?

Thanks!

eber42 2008-02-23 07:26

Re: Python and the LEDs on the n810
 
Here is a small example (blinks the led for 10 seconds) :

Code:

#! /usr/bin/python

import time
import dbus
bus = dbus.SystemBus()
obj = bus.get_object('com.nokia.mce','/com/nokia/mce/request')
iface = dbus.Interface(obj,dbus_interface='com.nokia.mce.request')
led_pattern = 'PatternCommonNotification'

# led on
iface.req_led_pattern_activate(led_pattern)

# wait 10s
time.sleep(10)

# led off
iface.req_led_pattern_deactivate(led_pattern)

You can find other patterns in /etc/mce/mce.ini

Eric


All times are GMT. The time now is 04:02.

vBulletin® Version 3.8.8