UNO Q Serial Monitor, strange output

Experienced strange output in a complex motor controller sketch. So I wrote the following sketch to see what happens. Same garbled output.

#include "Arduino_RouterBridge.h"
int a = 0;
int b = 1;

void setup() {
  // put your setup code here, to run once:
  Monitor.begin();
}

void loop() {
  // put your main code here, to run repeatedly:
  Monitor.print("a = ");
  Monitor.println(a);
  Monitor.print("b = ");
  Monitor.println(b);  
  Monitor.print("a + b = ");
  Monitor.println(a+b);  
  a += 1;
  b += 1;
  delay(1000);
}

Screenshot Output in AppLab:


Screenshot Output in Arduino IDE:

Any idea, what's wrong

If you upload your sketch by Arduino IDE, output will be perfect

Unfortunately not, see screenshot above. Did you use Serial.println()?

Why not Bridge.begin(); code?

Message/data from MCU goes to MPU through router bridge and then goes to Console>>python over the USB-C/USB-A connector.

I wanted to port a more complex sketch for motor controller from Uno to Uno Q.
This is only a test for calculations and output in the Serial Monitor.
Bridge.begin() alone did not change the situation with wrong end of line commands.
I will try data relay to Python and output in the shell later.

And I will try SBC mode.

Follow SSS (start with Small Step) Strategy to see success!

Hi @legoexpert2011. I think you are encountering this bug:

The developers are working on a fix:

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

Thanks, I subscribed

1 Like

I also had lots of issues with printing out results. Here is what worked for me:

void setup() {
  Monitor.begin();
  delay(1000);

}

Give Monitor a chance to get its act together.

Get rid of the println’s since they don’t appear to work.

Use this instead:

    Monitor.print("******************\n");
    Monitor.flush();

Get rid of all ambiguity to avoid shuffling outputs as follows: Compose your string, then print it out.

    String tm_out = "Elapsed time = " + tm_elt + "\n end loop\n";
    Monitor.print(tm_out);

instead of something like:

Monitor.print("Elapsed time = ")
Monitor.println(tm_elt)
Monitor.println(" end loop")

Good luck.