A couple of questions. The values that you assign to mode are 0 and 1. Those values both fit in a byte.
You are referencing mode in both loop() and the ISR, and yet mode is not declared volatile. Why not?
A couple of questions. The values that you assign to mode are 0 and 1. Those values both fit in a byte.
You are referencing mode in both loop() and the ISR, and yet mode is not declared volatile. Why not?