So, I am still learning. Any thoughts on how to combine this
const int LED = 13; //pin for LED
const int BUTTON = 7; //push button pin
int val = 0; //val used to store state of pin
int old_val = 0; //stores previous state of val
int state = 0; //0 = LED off and 1 = LED on
void setup () {
pinMode(LED,OUTPUT); //LED is output
pinMode(BUTTON, INPUT); //BUTTON is input
}
void loop (){
val = digitalRead(BUTTON); //read input and store it
//check transition
if((val == HIGH) && (old_val == LOW)){
state = 1 - state;
delay(10);
}
old_val== val; //val is now old..store it
if (state == 1){
digitalWrite(LED,HIGH); //turn LED on
}else{
digitalWrite(LED,LOW);
}
}
momentary button with a Switch/ Case function? The end result I'd like would be push button= LED goes on..Push button= LED blinks..Push button=throb....push button= off..
Any guidance from the community would be great
Wow, Thanks pYro_65..
That is way more complex than I thought it would be and introduces more for me to digest.. I'll have to spend some time on that one.
Did you write that on the fly?