You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
led blink code regressed again, we should maybe offer a thread based led animator #324
Take a look at OpenRoberta/robertalab-ev3dev@a95051b, before I was using the trigger feature and e.g. when using this with color=orange for left+right, the blinking was completely out of sync, one got the left led first turning green and maybe orange and then red and so on. With a blink thread we can do much more.
So far it works well. I'll test more and keep you posted. I don't mind to release a version with this and if it fare well extract it into the bindings. This also gives us some time to design the api.
Yes it works fine for me. I had a few courses by now and no complaints. And yes it solved the problem in #262 as well. What I like about it is that we can easilly add highlevel api with a bunch of led anims (pulsing, color cycling, ...).
I am still getting the error
Traceback (most recent call last):
File "led_test.py", line 21, in
Leds.set(Leds.LEFT, brightness_pct=0.5, trigger='timer')
File "/usr/lib/python3/dist-packages/ev3dev/ev3.py", line 90, in set
setattr(led, k, kwargs[k])
File "/usr/lib/python3/dist-packages/ev3dev/core.py", line 2516, in trigger
raise Exception('"{}" attribute has wrong permissions'.format(attr))
Exception: "delay_on" attribute has wrong permissions
Try putting a delay between setting the trigger to 'timer' and setting the delay_* attributes. Udev needs time to properly set the permissions of those attributes.
Activity
WasabiFan commentedon Jun 2, 2017
How's the performance of that blink code on the EV3? Is the blink consistent?
ensonic commentedon Jun 2, 2017
So far it works well. I'll test more and keep you posted. I don't mind to release a version with this and if it fare well extract it into the bindings. This also gives us some time to design the api.
dwalton76 commentedon Aug 31, 2017
@ensonic I like the idea of a thread to control led blinking...did you get this going?
dwalton76 commentedon Sep 1, 2017
If we had a thread class to control LED(s) would that kill the need to tackle #262 ?
ensonic commentedon Sep 5, 2017
Yes it works fine for me. I had a few courses by now and no complaints. And yes it solved the problem in #262 as well. What I like about it is that we can easilly add highlevel api with a bunch of led anims (pulsing, color cycling, ...).
dwalton76 commentedon Sep 7, 2017
@ensonic would you be willing to port it to here?
ensonic commentedon Sep 8, 2017
I'll take a look.
bonmotwang commentedon Apr 25, 2018
I am still getting the error
Traceback (most recent call last):
File "led_test.py", line 21, in
Leds.set(Leds.LEFT, brightness_pct=0.5, trigger='timer')
File "/usr/lib/python3/dist-packages/ev3dev/ev3.py", line 90, in set
setattr(led, k, kwargs[k])
File "/usr/lib/python3/dist-packages/ev3dev/core.py", line 2516, in trigger
raise Exception('"{}" attribute has wrong permissions'.format(attr))
Exception: "delay_on" attribute has wrong permissions
My code:
Leds.all_off()
Leds.set(Leds.LEFT, brightness_pct=0.5, trigger='timer')
Leds.set(Leds.LEFT, delay_on=3000, delay_off=500)
Leds.set_color(Leds.LEFT, Leds.RED)
dlech commentedon Apr 25, 2018
Try putting a delay between setting the trigger to 'timer' and setting the delay_* attributes. Udev needs time to properly set the permissions of those attributes.
LED animation support (#567)