Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Led Animations do not allow for non-blocking usage #753

Open
WesleyJ-128 opened this issue Jul 22, 2020 · 0 comments
Open

Led Animations do not allow for non-blocking usage #753

WesleyJ-128 opened this issue Jul 22, 2020 · 0 comments
Labels

Comments

@WesleyJ-128
Copy link

WesleyJ-128 commented Jul 22, 2020

  • ev3dev version: 4.14.117-ev3dev-2.3.5-ev3
  • ev3dev-lang-python version:
    Desired=Unknown/Install/Remove/Purge/Hold
    | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
    |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
    ||/ Name Version Architecture Description
    +++-==============-============-============-=================================
    ii micropython-ev 2.1.0 all Python language bindings for ev3d
    ii python3-ev3dev 1.2.0 all Python language bindings for ev3d
    ii python3-ev3dev 2.1.0 all Python language bindings for ev3d

I was trying to use the leds on the EV3 as status indicators for certain points in the driving programs that I am writing. As I am not familiar with how to use the led functions in ev3dev, I created a simple test program:

from ev3dev2.led import Leds
from time import sleep
lights = Leds()
lights.all_off()
lights.animate_police_lights('YELLOW', 'GREEN', duration=None, block=False)
print("test")
sleep(10)
print("test1")
lights.reset()
print("test2")
sleep(5)

I expected this to turn the leds off and immediately start the police light animation, print test, let the animation run for ten seconds, print test1, set both lights to green, print test2, then wait five seconds before completion. However, when I run this program, the leds turn off after some amount of startup time, test is printed, then after 10 seconds, test1 is printed, and the lights stay off and the program never progresses farther, without throwing any error messages. If I set duration= to 5, I get the exact same behavior. If I also change block= to True, the animation is played for 5 seconds, test is printed, and after 10 seconds, the program continues as expected.

I have also tried this program with other animation types, and I get identical behavior.

The print statements were added as progress markers after I found the program was acting strangely.

@WasabiFan WasabiFan added the bug label Aug 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants