marcobrianza / ClickButton

A simple button Arduino library to get short and long clicks, multiple clicks (double click, triple click etc.). Click-and-hold is also possible.
63 stars 28 forks source link

Hold button down to increase a varible #10

Open j209177 opened 2 years ago

j209177 commented 2 years ago

Hi, I am using this library for a flashlight button and was wondering if you would be so gracious as to guide me in figuring out how to hold the button down to ramp up the PWM signal to the LED. Without letting go of the button.

Below is my attempt in coding my desired outcome.

for reference in the code, antiBlueSpotsRamp is to see if the flashlight is unlocked.

''' if(button1.clicks == -1 and antiBlueSpotsRamp == 1){ brightness = brightness + brightnessIncrease; '''

It would mean more than you know if you were able to help me in figuring this out. Days have been wasted searching on how to achieve this ramping outcome.