I am working on the atmel programming and I am trying to make a program that has a function that returns a Boolean that is once true and the second time is false that depends on whether is it called before or not like it returns true the first time an the second it returns false and I would make the program like::
if(boolean == true){
//execute the code if the button is pressed for the first time
//switch on a led
}else{
//execute the code if the button is pressed for the second time
//turn off the led
}
the function is like::
bool ledToggle(){
if(function is called for the first time)
return true;
}else{
return false;
}