Hello everyone, please help. The problem is this: a char array cannot be larger than 255, why? Here is an example:
....
if (Serial.available() > 0) {
char incoming[400];
Serial.readBytes(incoming,400);
Serial.println(incoming);
}
....
So, when I send ower serial text that is, for example, 350 characters long, serial read only 255.
if I make:
....
if (Serial.available() > 0) {
char incoming[400];
String string=Serial.readString();
Serial.println(string);
Hello everyone, please help. The problem is this: a char array cannot be larger than 255, why? Here is an example: .... if (Serial.available() > 0) { char incoming[400]; Serial.readBytes(incoming,400); Serial.println(incoming); } .... So, when I send ower serial text that is, for example, 350 characters long, serial read only 255. if I make: .... if (Serial.available() > 0) { char incoming[400]; String string=Serial.readString(); Serial.println(string);
string.toCharArray(incoming,400); Serial.println(incoming); } ....
now String works perfect but char is limited to 255. Thanks in advance.