Skip to content
Discussion options

You must be logged in to vote

Or if you want to print to two serial devices on a part with one UART use an alternating schedule.

void setup() {
}

void loop() {
  Serial.begin(115200);
  Serial.println("This is UART0 on default pin with 115200 baud");
  Serial.end();
  delay(1000);
  Serial.swap(1); // set to alternate
  Serial.begin(9600);
  Serial.println("This is UART0 on alternate pin with 9600 baud");
  Serial.end();
  Serial.swap(0); // set back to default pins
  delay(1000);
}

Replies: 3 comments 17 replies

Comment options

You must be logged in to vote
5 replies
@coderatchance
Comment options

@mechatroniks-git
Comment options

@coderatchance
Comment options

@mechatroniks-git
Comment options

@coderatchance
Comment options

Comment options

You must be logged in to vote
2 replies
@mechatroniks-git
Comment options

@coderatchance
Comment options

Comment options

You must be logged in to vote
10 replies
@coderatchance
Comment options

@coderatchance
Comment options

@hmeijdam
Comment options

@hmeijdam
Comment options

Answer selected by coderatchance
@coderatchance
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants