Global variable not sticking

noingwhat:
Can you try initializing sensorOrPen as sensor / 0?

I can. It is a waste of time. The sensorOrPen code can be debugged with eyeballs and a brain.

That's what was causing a bug on my end.

Oh specious reasoning. Good times are a coming...


byte sensorOrPen = 0;
Current device is the 0. Sensor is 0 Pen is 1. We are currently using the sensor. New device is the 1
Current device is the 1. Sensor is 0 Pen is 1. We are currently using the pen. New device is the 0
Current device is the 0. Sensor is 0 Pen is 1. We are currently using the sensor. New device is the 1
Current device is the 1. Sensor is 0 Pen is 1. We are currently using the pen. New device is the 0
...

byte sensorOrPen;
Current device is the 0. Sensor is 0 Pen is 1. We are currently using the sensor. New device is the 1
Current device is the 1. Sensor is 0 Pen is 1. We are currently using the pen. New device is the 0
Current device is the 0. Sensor is 0 Pen is 1. We are currently using the sensor. New device is the 1
Current device is the 1. Sensor is 0 Pen is 1. We are currently using the pen. New device is the 0
...