For reference, this code works even if the arduino IDE was never opened. It is for ROS but doesn't use rosserial, which I have found to be unreliable in the past.
The only time this code breaks is if the computer is...
I have a Teensy 3.6. I can upload sketches (for example the 'Hello World' sketch in examples) from my Ubuntu laptop to the Teensy. The serial output can then be read on my windows 10 laptop after I connect the USB cable...