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

Slow reaction time #31

Open
2Kreeper opened this issue Feb 27, 2018 · 0 comments
Open

Slow reaction time #31

2Kreeper opened this issue Feb 27, 2018 · 0 comments

Comments

@2Kreeper
Copy link

To be clear: I absolutely love this API.
But there is one slight problem when using it: Every time you change colors, you have to wait about a second before colors change, which makes it impossible to react quickly to events like keystrokes.

But I was able to find the issue and fix it:

  1. Go to the create_command function and remove the line strips = [0, strips_info(ser, 1)-1, strips_info(ser, 2)-1]
  2. Go to the init function and add the following code at the very top:
    if not "INITED" in globals():
        global INITED
        INITED = False
    if INITED:
        return
    global strips
    strips = [0, strips_info(ser, 1)-1, strips_info(ser, 2)-1]```

This stops a pretty time-intensive initialization from being called every time you change the LEDs and instead only calls it once

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant