Serial.println statements not printing in Setup()

Hi, can someone help me understand why my Serial.println statement in Setup() won’t output to the serial port (I’m using TeraTerm v.4.98). Inside the Void loop I can get printf statements to work. I’m using an Electron 0.7.0 OS. Thanks

SYSTEM_MODE(MANUAL);

void setup() {
    Serial.begin(9600);
    delay(1000);
    Serial.println("I'm printing just fine");

}

void loop() {

}

are you sure that teraterm is connected to the device in the 1 second delay? Try waiting for the serial port to connect or you press a key to continue like.

while(!Serial.available()){};

1 Like

Thanks for the suggestion. I made the chnage, but I’m still not seeing the Serial.println statement in TeraTerm. Here’s the updated code.

SYSTEM_MODE(MANUAL);

void setup() {
    Serial.begin(9600);
    while(!Serial.available()){}; 
    Serial.println("I'm printing just fine");

}

void loop() {

}

Update: the while statement did help and the Serial.println instructions are showing up in TeraTerm.

However, this solution really doesn’t address the underlying issue: why can’t TeraTerm capture the serial output in Setup()?

Are there any other methods (or terminal programs) or settings that I can use to address this?

It may be because you have just set up the serial port; I don’t think the computer could open a virtual COM port until it has been setup.

Also, try using waitUntil(Serial.isConnected());

If that doesn’t work, I would add like a delay(5000) before you try to print) to see if that makes a difference.

1 Like