I am using a bread boarded arduino. Inside my interrupt functions I want to read the value of one of my GPIO pins and then increment a counter if it is low. I am doing that using the following.
displayValues[4]++;
hasButtonPushed = true;
if(digitalRead(BUTTON_A) == LOW) {
displayValues[5]++;
}
if(digitalRead(BUTTON_B) == LOW) {
displayValues[6]++;
}
if(digitalRead(BUTTON_C) == LOW) {
displayValues[7]++;
}
However, even when the input line is directly tied to high, the code returns low. I don’t believe that my Atmel is damaged. Any ideas?
The problem was an issue with the arduino library that was causing digital read not to work. The newer arduino versions fixed this issue but I got around it by rewriting everything into native AVR.