The easiest way is to use TyQt, there is a GUI and a command line version:1) how can I (soft) reset a teensy when it's PC connected?
https://forum.pjrc.com/threads/27825-Teensy-Qt
The easiest way is to use TyQt, there is a GUI and a command line version:1) how can I (soft) reset a teensy when it's PC connected?
Why not ?thanks for all the suggestions. I think I need to invest in TyQt.
Because teensy does not reset when Serial Monitor is restarted, the only method I have so far is to recompile and upload the same code ... seems a bit weird to me.
It does not know it - because..it is not possible. Upload is USB only.If I use a FTDI adapter into Serial1, how does teensy know new code is now uploaded via Serial1?
No. Serial. (<-- no number)(Is the USB port called Serial0?)
/* Reset on dtr high -> dtr lo
*
* Frank B 16/10/17
*/
void resetWhenTerminalStops() {
static int8_t stateOfDtr = 0;
if (stateOfDtr==0 && Serial.dtr()) stateOfDtr=1;
else
if (stateOfDtr==1 && !Serial.dtr()){
SCB_AIRCR = 0x05FA0004; // software reset
}
}
void setup() {
// put your setup code here, to run once:
while(!Serial);
delay(100);
Serial.println("R E S E T");
}
void loop() {
// put your main code here, to run repeatedly:
resetWhenTerminalStops();
//Do something useful
delay(100);
Serial.println("Running");
}
Serial.begin(38400);
while (!Serial && (millis () <= 5000)) ;
Serial.println("Hello World");