Serial Monitor statements

One of the most obvious errors you made in your sketch (and I already have pointed it out in a previous answer) is the assignment to prevState. The whole point about prevState is to compare it with currState. If you write prevState = currState and then compare their values, you're doing it wrong. You have to do that assignment after comparing the two values.

I'm glad my code works for you. Feel free to ask if there's something else you don't understand. :slight_smile: