Skip to content

Hold button down to increase a varible #10

Description

@j209177

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions