Teensy 3.2 USB Serial.println no output

Status
Not open for further replies.

isdale

Active member
Aloha
I picked up my Teensy stuff again (working a DMX project) and came across an issue using the Arduino IDE Serial Monitor - it shows nothing.

My Teensy 3.2 has the USB power line cut (as 5v comes in via the OctoWS8211 board from a bench supply), if that makes any difference.

When my test sketches (Octo library Basic Example) didnt emit println statements, I fell back to making a trivial Hello World - stuck a Serail.println("Hello World") in the default empty setup() function. Build on Win10 in IDE 1.8.13, fed to Teensy using Loader 1.53. Open the Serial Monitor and nothing comes out.
As I understand Teensy, it does not require Serial.begin() when using the USB serial, correct?
So why isnt this working?

void setup() {
// put your setup code here, to run once:
Serial.println("Hello World");
}

void loop() {
// put your main code here, to run repeatedly:

}
 
The teensy will likely have output the line before the Serial system was ready for it...

So you might try something like:
Code:
void setup() {
   // put your setup code here, to run once:
   // wait for up to 5 seconds for serial port to be available and ready
    while (!Serial && (millis() < 5000)) ;
    Serial.println("Hello World");
}

void loop() {
  // put your main code here, to run repeatedly:

}
 
As I understand Teensy, it does not require Serial.begin() when using the USB serial, correct?

Yes, confirmed, Serial.begin() is not needed on Teensy.

But you do need to wait for the serial monitor if you want the first thing printed to actually show up. Otherwise your first printing is done before your PC has finished detecting the freshly rebooted USB device (called "enumeration" in USB lingo).
 
Yep that was it. Needed to wait till Serial got up and running.
Gonna remember that for the DMX stuff next.
Thanks!

The teensy will likely have output the line before the Serial system was ready for it...

So you might try something like:
Code:
void setup() {
   // put your setup code here, to run once:
   // wait for up to 5 seconds for serial port to be available and ready
    while (!Serial && (millis() < 5000)) ;
    Serial.println("Hello World");
}

void loop() {
  // put your main code here, to run repeatedly:

}
 
Status
Not open for further replies.
Back
Top