# QWIIC Button Queue

**URL:** <https://community.sparkfun.com/t/qwiic-button-queue/47533>\
**Category:** Qwiic System\
**Tags:** qwiic\
**Created:** [June 5, 2024, 6:00pm UTC](https://community.sparkfun.com/t/qwiic-button-queue/47533 "2024-06-05T18:00:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![GrumpySB](https://avatars.discourse-cdn.com/v4/letter/g/a698b9/32.png) [@GrumpySB](https://community.sparkfun.com/u/GrumpySB)\
**Post date:** [June 5, 2024, 6:00pm UTC](https://community.sparkfun.com/t/qwiic-button-queue/47533/1 "2024-06-05T18:00:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![TS-Russell](https://yyz1.discourse-cdn.com/sparkfun/user_avatar/community.sparkfun.com/ts-russell/32/6092_2.png) [@TS-Russell](https://community.sparkfun.com/u/TS-Russell)\
**Post date:** [June 5, 2024, 10:53pm UTC](https://community.sparkfun.com/t/qwiic-button-queue/47533/2 "2024-06-05T22:53:25Z")

</div>

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

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

```

Or adding in debug info to the code

```auto
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");
}

```

---

<div class="post-metadata">

**Author:** ![GrumpySB](https://avatars.discourse-cdn.com/v4/letter/g/a698b9/32.png) [@GrumpySB](https://community.sparkfun.com/u/GrumpySB)\
**Post date:** [June 6, 2024, 12:51pm UTC](https://community.sparkfun.com/t/qwiic-button-queue/47533/3 "2024-06-06T12:51:02Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![GrumpySB](https://avatars.discourse-cdn.com/v4/letter/g/a698b9/32.png) [@GrumpySB](https://community.sparkfun.com/u/GrumpySB)\
**Post date:** [June 6, 2024, 1:15pm UTC](https://community.sparkfun.com/t/qwiic-button-queue/47533/4 "2024-06-06T13:15:28Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![TS-Russell](https://yyz1.discourse-cdn.com/sparkfun/user_avatar/community.sparkfun.com/ts-russell/32/6092_2.png) [@TS-Russell](https://community.sparkfun.com/u/TS-Russell)\
**Post date:** [June 7, 2024, 9:02pm UTC](https://community.sparkfun.com/t/qwiic-button-queue/47533/5 "2024-06-07T21:02:32Z")

</div>

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
