Hi,
I'm using the "One Button" library shown here - http://www.mathertel.de/Arduino/OneButtonLibrary.aspx
I have the arduino recognizing double clicks.
I would like to use multiple double clicks as a sort of menu system.
First double click - do this
Second double click - do that
Third double click do - do something else
etc etc
How would a hacker like me go about this?
Current code example for 1st double click:
void doubleclick() {
strip.begin();
strip.setPixelColor(0, 255, 255, 255);
strip.show();
}
Thank you! =)
Double Clicking and Neopixels
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- Franklin97355
- Posts: 23911
- Joined: Mon Apr 21, 2008 2:33 pm
Re: Double Clicking and Neopixels
You would write code that would keep track of how many times doubleclick has been called. Then you could use a case statement to execute your code. Or you could use a state machine so that if doubleclick and state=1 then state = 2; do something else.
-
- Posts: 8
- Joined: Thu Jun 26, 2014 7:38 pm
Re: Double Clicking and Neopixels
Thank you for the info Franklin.
I'm pretty much new to coding but that will send me in the right direction. =)
I'm pretty much new to coding but that will send me in the right direction. =)
Please be positive and constructive with your questions and comments.