Please forgive me for this noob question. I'm trying to write a simple program to do the following:
Input 1 - tact switch
Output 1 - LED
Analog input 1 - Potentiometer
I'm trying to cycle through 3 different states by pushing the tact switch 3 consecutive times:
State 1 - light off
State 2 - light blinking at frequency determined by potentiometer
State 3 - light solid
....then back to state 1 if button is pushed again.
I've had no trouble establishing the contents of each state but I'm having a tough time getting the cycling portion to work with only button.
Thus far I've tried:
If...else
switch case
I'm grateful for any advice you can provide on program structure.