I'm getting the error "expected '}' before 'else' in the following code. I'm sure it's something simple, but I can't figure it out. All of my braces line up.
Any suggestions?
int SSbuttonPress = 0;
int buttonTime;
int SSButtonPin;
int cycleDisplayFlag;
int lastState;
void setup() {
// put your setup code here, to run once:
}
void loop()
{
// int checkButtons()
//{
int ssDebounceTime = 200; //Set Debounce at 2 seconds for Start/Stop
int cdDebounceTime = 25; //and 25mS for cycle display
int buttonPressed = 0; //This is what will be returned. 1 for Start/Stop and 2 for Cycle Display
noInterrupts();
if (SSbuttonPress) //Has the Start/Stop Button been pressed
{
long int x = millis();
long int y = x-buttonTime;
int currentState = digitalRead(SSButtonPin);
if (currentState);
{
if (y >= cdDebounceTime) //Has it been pressed for appropiate time
{
cycleDisplayFlag = true;
if (y >= 2000)
{
cycleDisplayFlag = 0; //If it's been pressed for more than 2 seconds then it's a start/stop situation.
SSbuttonPress = 0;
lastState = 0;
buttonTime = 0;
buttonPressed = 1; //This means the The Start/Stop button has been pressed.
}
}
}
else if(cycleDisplayFlag) //If the cycle display flag is set and the button is no loger pressed then the Cycle Display Button has been pressed.
{
cycleDisplayFlag = 0;
buttonPressed = 2;
lastState = 0;
buttonTime = 0;
}
}
//interrupts();
//return(buttonPressed);
}