0

I am currently experimenting with Strings and reading data from serial on an Arduino. But i find that when you are using Strings to read data from the serial or to compare it to another string, it is extremely slow(takes about one sec). It changed back to the normal, fast speed when i am using chars to read from serial. Why is it so slow?

thanks

Unturned
  • 15
  • 7

1 Answers1

0

According to this link,

https://www.arduino.cc/en/Serial/ReadString

Serial.readString() reads characters from the serial buffer into a string. The function terminates if it times out

here is the timeout method description

https://www.arduino.cc/en/Serial/SetTimeout

Moonlight
  • 232
  • 2
  • 5
  • 18