Question Marks in Serial Monitor

Hi, how to get rid of those question marks in my serial output?
I've a Arduino Nano and am using a baud rate of 19200.

    Serial.println(" ");
    Serial.println("┌──────────┬────────────────────┐");
    Serial.println("│ Sensor   │     Messwert [mm]  │");
    Serial.println("├──────────┼────────────────────┤");
    Serial.print(  "│ Sensor 3:│     ");
    Serial.println(modbus_array[0]);

    Serial.print(  "│ Sensor 4:│     ");
    Serial.println(modbus_array[1]);

    Serial.print(  "│ Sensor 5:│     ");
    Serial.println(modbus_array[2]);

    Serial.print(  "│ Sensor 6:│     ");
    Serial.println(modbus_array[3]);

    Serial.print(  "│ Sensor 7:│     ");
    Serial.println(modbus_array[4]);

    Serial.print(  "│ Sensor 8:│     ");
    Serial.println(modbus_array[5]);

    Serial.print(  "│ Sensor 9:│     ");
    Serial.println(modbus_array[6]);
    
    Serial.println("├──────────┼────────────────────┤");

    Serial.print(  "│ Fails    │   ");
    for(int sensor=0; sensor<7; sensor++){
          Serial.print(measurement_failed[0]);Serial.print(  ", ");
    }
    Serial.println("");

    Serial.println("└──────────┴────────────────────┘");

Untitled

Not sure, didn't happen to me on my Uno. I don't have the modbus_array in the version I made to test it though. Saved a bunch of dynamic memory using the F macro though (34 vs 9%).

void setup() {
  Serial.begin(19200);
  Serial.println(" ");

  Serial.println(F("┌──────────┬────────────────────┐"));
  Serial.println(F("│ Sensor   │     Messwert [mm]  │"));
  Serial.println(F("├──────────┼────────────────────┤"));
  Serial.print(F(  "│ Sensor 3:│     "));
  Serial.println(F(""));

  Serial.print(F(  "│ Sensor 4:│     "));

  Serial.println(F(""));
  Serial.print(F(  "│ Sensor 5:│     "));

  Serial.println(F(""));
  Serial.print(F(  "│ Sensor 6:│     "));
  Serial.println(F(""));

  Serial.print(F(  "│ Sensor 7:│     "));

  Serial.println(F(""));
  Serial.print(F(  "│ Sensor 8:│     "));
  Serial.println(F(""));

  Serial.print(F(  "│ Sensor 9:│     "));
  Serial.println(F(""));

  Serial.println(F("├──────────┼────────────────────┤"));

  Serial.print(F(  "│ Fails    │   "));

  Serial.println(F(""));

  Serial.println(F("└──────────┴────────────────────┘"));
}
void loop() {

}


1 Like

Do you need to use baud rate 19200?
I'm not sure if that would affect anything, but maybe.

If you need a module to use baud 19200, use Software Serial

or have multiple `Serial` instances with something like this (click the arrow)
void setup() {
  Serial.begin(9600); // for printing to serial monitor
  Serial2.begin(19200); // for other module using 19200 baud
}

void loop(){
  // your code here:

  // Now use Serial.println() and Serial2.println()
}

@anon44338819

1 Like

Is this a Nano clone?
Is it setup for 8 or 16 MHz?
This could be a similar issue as here.

1 Like

Interesting thanks, this minimal example caused problems for me too.

@dlloyd
I played around with the baudrates in the monitor and the serial interface instance, with worse results.

@anon44338819 This is not so bad actually, these print out tables are primarily for debugging. The device will serve as a modbus slave, using the same baudrate. I hope those artefacts won't show up there.

1 Like

Hi @erespeel. Thanks for giving the Arduino IDE 2.0.0 release candidate a try.

This bug is being tracked by the Arduino IDE developers here:

If you have a GitHub account, you can subscribe to that issue to get notifications of any new developments related to this subject.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.