# ClickButton Defaults - distinguishing between short and long click

**URL:** https://community.particle.io/t/clickbutton-defaults-distinguishing-between-short-and-long-click/52077
**Category:** Getting Started
**Created:** [September 9, 2019, 6:42pm UTC](https://community.particle.io/t/clickbutton-defaults-distinguishing-between-short-and-long-click/52077 "2019-09-09T18:42:45Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![NJD](https://avatars.discourse-cdn.com/v4/letter/n/5f9b8f/32.png) [@NJD](https://community.particle.io/u/NJD)
#### Post date: [September 9, 2019, 6:42pm UTC](https://community.particle.io/t/clickbutton-defaults-distinguishing-between-short-and-long-click/52077/1 "2019-09-09T18:42:45Z")

</div>

Hello,

I am new to the Particle community and am testing out the Grove Sensor kit button with the ClickButton library. With the library defaults for debounceTime, multiclickTime, and longClicktime, and the Grove Button as an input, single short clicks register as a long click despite clicking the button as fast as possible. I tried modifying the variable defaults however haven’t been able to adjust them to distinguish between a short and a long press. Is this achievable with the library? If so, can someone advise what changes should be made to the defaults? Thanks!

---

<div class="post-metadata">

### Author: ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)
#### Post date: [September 10, 2019, 11:13am UTC](https://community.particle.io/t/clickbutton-defaults-distinguishing-between-short-and-long-click/52077/2 "2019-09-10T11:13:06Z")

</div>

That’s probably due to the wrong polarity selected in your code.  
The Grove Sensor Kit button is active HIGH, but the ClickButton library example assumes an active LOW button.  
You should use this constructor

```cpp
ClickButton button1(buttonPin1, HIGH);

```

---

<div class="post-metadata">

### Author: ![NJD](https://avatars.discourse-cdn.com/v4/letter/n/5f9b8f/32.png) [@NJD](https://community.particle.io/u/NJD)
#### Post date: [September 10, 2019, 5:28pm UTC](https://community.particle.io/t/clickbutton-defaults-distinguishing-between-short-and-long-click/52077/3 "2019-09-10T17:28:59Z")

</div>

@ScruffR, thanks that worked! Cheers.
