Skip to content
This repository has been archived by the owner on Nov 23, 2019. It is now read-only.

LED devices don't have delay_on/delay_off properties #62

Open
ensonic opened this issue Jul 21, 2015 · 4 comments
Open

LED devices don't have delay_on/delay_off properties #62

ensonic opened this issue Jul 21, 2015 · 4 comments

Comments

@ensonic
Copy link

ensonic commented Jul 21, 2015

The code in https://github.com/topikachu/python-ev3/blob/master/ev3/ev3dev.py#L464-465 exposes delay_on/off properties for the timing. Allthough:

ll /sys/class/leds/ev3-left0:red:ev3dev/
total 0
-rw-rw-r-- 1 root ev3dev 4096 Jul 21 15:15 brightness
lrwxrwxrwx 1 root root      0 Jan  1  2000 device -> ../../../leds_pwm
-r--r--r-- 1 root ev3dev 4096 Jan  1  2000 max_brightness
drwxr-xr-x 2 root root      0 Jan  1  2000 power
lrwxrwxrwx 1 root root      0 Jan  1  2000 subsystem -> ../../../../../class/leds
-rw-rw-r-- 1 root ev3dev 4096 Jul 21 15:15 trigger
-rw-rw-r-- 1 root ev3dev 4096 Jan  1  2000 uevent
@dlech
Copy link

dlech commented Jul 21, 2015

You have to set trigger to timer in order to create the delay_on and delay_off attributes in sysfs. This has some unfortunate side effects. See ev3dev/ev3dev#225 for more information.

My advice would be to implement your own blinking function rather than relying on the timer trigger.

@topikachu
Copy link
Owner

@dlech Is https://github.com/ev3dev/ev3dev/wiki/Using-the-LEDs out of date? It still has delay_on/off

@dlech
Copy link

dlech commented Aug 4, 2015

The leds class is part of the mainline linux kernel, so it has not changed and is not likely to. You can use the timer trigger. I just don't recommend it because of permissions and race condition issues with the dynamic sysfs attributes (delay_on/delay_off).

@dlech
Copy link

dlech commented Aug 4, 2015

I suppose we should add a link to the issue I mentioned above to that page though.

aleh-arol added a commit to aleh-arol/python-ev3 that referenced this issue Nov 7, 2015
…utes; force LED trigger mode flush on write.
topikachu added a commit that referenced this issue Jan 29, 2016
#62: add force flush meta attribute for ev3dev object attributes
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants