1

Don't do serial prints inside an ISR. Your variable enable should be declared volatile as it changes inside an ISR. The compiler is entitled to cache the variable value if you don't do that. You are inconsistent in your use of enable. You test for LOW or HIGH but set it to 0 or 1. Now they happen to be the same, but someone might wonder. If you are going ...


Only top voted, non community-wiki answers of a minimum length are eligible