QWIIC Button Queue

The QWIIC Button Queue feature does not appear to function properly.

Either my 'Grey Cells" - neural network has excessive noise or the queue of the button is faulty.

No matter how many times I pop the Click Queue I get the same values.

I can’t seem to empty the queue.

When I do 2 button pushes separated by a second or two and then popClickedQueue(), I get the time of

the first button click, but not the second.

No matter how many times I, popClickedQueue() I can’t empty the queue and the second, or subsequent

button pushes, do not appear.

When I print; Serial.print(button.timeSinceFirstClick()/1000.0);

the same value keeps being printed (of course different from the amount of time I last time I printed),

but I would expect popping the queue would take that value off the queue : FIFO

How big is the FIFO??

Please help me fix my “Grey Cells” rewiring.

GumpySB

It sounds like you probably have an issue with debounce or timing; try adding:

button.setDebounceTime(50); // Increase the debounce time to 50 milliseconds

Or adding in debug info to the code

if (button.isClicked()) {
  Serial.print("Button clicked at: ");
  Serial.println(button.timeSinceFirstClick());
  int queueSize = button.getClickedQueueSize();
  Serial.print("Queue size: ");
  Serial.println(queueSize);
}

if (button.isReleased()) {
  Serial.println("Button released");
}

if (button.wasDoubleClicked()) {
  Serial.println("Double click detected");
}

Thanks for adding to my neural network.

I’m curious, there is no mention of the getClickedQueueSize() function in the ‘.h’ file.

Are there any other interesting functions available?

Tried your suggestions.

Unfortunately, my compiler(Arduino) header file does not recognize

isClicked(); getClickedQueueSize(); wasDoubleClicked();

the cool functions you suggested.

is there a header file you can recommend that has the additional

functions?

Not ready-made, those were just examples of variables that could be used; take at look online at other debounce fixes and then write one into your code