adafruit / Adafruit_CircuitPython_NeoTrellis

CircuitPython library for the Adafruit RGB Trellis
MIT License
8 stars 14 forks source link

Cleaning neotrellis buffer #7

Closed gborgonovo closed 5 years ago

gborgonovo commented 5 years ago

Hi there, I'm creating a "sound box" with Neotrellis 4x4 with Raspberry Pi. It happens that if you click two buttons in a while it takes both events, run the first one and keep the second one for later. If in the meanwhile you click again two buttons it queues everyting. In my project it plays a sound or song when you click the button, and it stops if you click a new one and play the corresponding new sound/song. So I'd like to keep only one event, the last one. It usually work quite well if you click one button, but if you click two (or more) of them (as my grandson usually does) they all go in the buffer and it continues to play each of them until it frees the buffer. Is there a way to clean the buffer or to have a buffer of one event?

Thank you

Giorgio

tannewt commented 5 years ago

For future questions please ask them on the Adafruit technical support forum here:

I don't see a way to clear the seesaw queue here. I do see that the Keypad super class gives access to a count of pending events. You could choose to ignore that number of events before playing the next song.

tannewt commented 5 years ago

Oops, forum is here: https://forums.adafruit.com/