Skip to content
This repository has been archived by the owner on Jan 2, 2023. It is now read-only.

Add Flickery-ness #5

Open
TravisBumgarner opened this issue Dec 10, 2018 · 4 comments
Open

Add Flickery-ness #5

TravisBumgarner opened this issue Dec 10, 2018 · 4 comments

Comments

@TravisBumgarner
Copy link
Owner

No description provided.

@tenth10th
Copy link

When a message isn't coming through, the lights could "flicker" (fade on and off quickly, in random durations). To avoid an obvious "rippling effect", we could also simply turn them all on (and then off) in random order, with (very small) random delays between each light action.

(That might be visually distracting / annoying when there isn't a message coming in - They could just all be on, or slowly fade alternating lights on and off, more like standard holiday light behavior.)

@tenth10th
Copy link

(For example, we could store a list of the integers [0 ... 26] and random.shuffle() it each time we want to turn lights on and off, rather than always activating / deactivating them in order.)

@TravisBumgarner
Copy link
Owner Author

Random exploration we did into this:


def flicker():
    flicker_duration = 100/1000
    while True:
        FLICKER_THRESHOLD = 990
        flicker_chance = random.randint(0,1000)
        if flicker_chance > FLICKER_THRESHOLD:
            flicker_value = random.randint(0,255)
            flicker_duration = random.randint(0,50)
            pixels[0] = (255,255,255, flicker_value)
        else:
            pixels[0] = OFF
        time.sleep(flicker_duration / 1000) 

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

2 participants