Hi Paul,
some observations:
- with original delay, windows plays the "usb
disconnect device" sound - but not the "usb connect device" sound. Perhaps this is not important and a windows problem. Or, maybe, increasing the 50ms would be a good idea.
- with increased delay (1000ms), windows plays both sounds.
- increased delay does not help the arduino serial monitor (and LED stays on)
BUT:
With original delays (50ms/350ms) the TYQT monitor works well and reconnects automatically on my Windows10 machine. It must be a Teensyduino problem (?!)
TYQT has an other problem for me, as it does not want to upload new code.
I had to: Upload code with the teensy loader, close it, start TYQT. (But that's a TYQT thing)
I've corrected your code a bit ;-) (copy & paste error with pinMode)
Code:
void setup() {
pinMode(13, OUTPUT);
digitalWrite(13, HIGH); // LED on when wait for serial monitor
Serial.begin(9600);
while (!Serial) ; // wait for serial monitor to reopen
digitalWrite(13, LOW); // LED off when connection to serial monitor
Serial.print("Bye, World");
delay(5000);
*(volatile uint32_t *)0xE000ED0C = 0x5FA0004;
}
void loop() {
}
EDIT:
During my testing, I managed to "brick" the teensy. It wasn't recognized by Windows anymore and seemed "dead".
I guess, TYQT was part of the problem.
The Teensyloader wasn't running, but the Taskmanager showed a running instance of teensyreboot.
Killing it, closing TYQT, reflashing with the teensyloader (after doing the "delete" trick with 15 sec button press) helped.