Hello,
my accidentally posted to much code in my last thread so I think it got a bit to long. But now I now at least the the problem is.
Here is the part of the setup rutine:
attachInterrupt(1, keypadButtonPressed, FALLING);
#ifdef TEST_WITH_DEBUG
Serial.println("Interrupt for keypad attached");
#endif
Here is the function keypadButtonPressed:
void keypadButtonPressed(){
#ifdef TEST_WITH_DEBUG
Serial.println("In keypadButtonPressed()");
#endif
detachInterrupt(1);
int newInt = processKeypad();
sendDigit(newInt);
if(newInt != NOTHING && newInt != ENTER && newInt != CLEAR){
#ifdef TEST_WITH_DEBUG
Serial.println("Is a number");
#endif
numbers[digitForNumbers] = newInt;
digitForNumbers--;
lcd.print(newInt);
numberNow = (numbers[0] * 1) + (numbers[1] * 10) + (numbers[2] * 100) + (numbers[3] * 1000) + (numbers[4] * 10000);
attachInterrupt(1, keypadButtonPressed, FALLING);
return;
}
else if(newInt == ENTER){
#ifdef TEST_WITH_DEBUG
Serial.println("Is enter");
#endif
addBib( (numbers[0] * 1) + (numbers[1] * 10) + (numbers[2] * 100) + (numbers[3] * 1000) + (numbers[4] * 10000) );
numbers[0] = 0;
numbers[1] = 0;
numbers[2] = 0;
numbers[3] = 0;
numbers[4] = 0;
numbers[5] = 0;
numberNow = 0;
digitForNumbers = 4;
attachInterrupt(1, keypadButtonPressed, FALLING);
return;
}
else if(newInt == CLEAR){
#ifdef TEST_WITH_DEBUG
Serial.println("Is clear");
#endif
numbers[0] = 0;
numbers[1] = 0;
numbers[2] = 0;
numbers[3] = 0;
numbers[4] = 0;
numbers[5] = 0;
numberNow = 0;
digitForNumbers = 4;
showTime();
attachInterrupt(1, keypadButtonPressed, FALLING);
return;
}
}
So, the problem is: I newer get into the interrupt function keypadButtonPressed. The message "In keypadButtonPressed" newer arrives at the computer.
Yes, TEST_WITH_DEBUG is defined and the serial communication is started with Serial.begin()
I'm using an ATmega644 with the Sanguino core files.
Please help as fast as possible, this must be done before tomorrow at this time, and I'm sure I will get more bugs later in other parts of the code.
JanD