Arduino Uno USART speed

I have an arduino uno board. I am trying to send a value from my computer to my arduino uno board serially using USART. However my arduino board is not receiving the value at the promised USART speed. For example I am sending the value from my computer at 115200 bps but my arduino uno board is not receiving the value at this speed. I know this because when I send the value repeteadly my arduino uno board can not keep up with the speed. I need to know the reason for this.

Welcome to the forum

Your topic has been moved to the Programming category of the forum as it is not a suggestion for the Arduino project itself

Please post your sketch, using code tags when you do

Could be a problem in your code.

1 Like

If the UNO receives the data correctly for even a short time, then the baud rate would have to be correct, otherwise nothing would ever be received.

Make sure your baud rates match.

Look to the serial input basics tutorial for robust ways to receive data.

1 Like

Here is the code that I am using:

int x = 0;
int T2 = 5;


void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  pinMode(13,OUTPUT);
}

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

  if (Serial.available() > 0) {
    x = Serial.readString().toInt();
  }
  else {
    goto ledblink;
  }

  if (x == 5) {
    digitalWrite(13,HIGH);
    delay(T2);
    digitalWrite(13,LOW);
    delay(T2);
  }

  
}

I am receving the data correctly. My baudrates are correct.

My baudrates match.

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