Do not use the String class with and Arduino. There is limited memory and zero garbage collection so in the end this technique will fail. Use the string class, note lower case s, it is a whole different thing.
I want to send a char to another device.
But you seem to be trying to send a string not a character?
To send a string use:-
Serial.print("my string here");
To send a character use
Serial.write(c); // where the variable c ( type chr ) is the exact bit pattern you want to send
jimLee:
this line.. "strcpy(d.name1, "USER1");" is jamming 6 bytes into unallocated memory.
"command1="t10.txt=""+d.name1+""";" I'm thinking this line causes a compiler error. I can't figure out what it does.
-jim lee
Thanks. You are right, it's the line which shows error.
I did not post full my code since it is huge. 'd.name1' is a char I stored in internal EEPROM. And I like to load it and send to Nextion LCD device allocates to t10.txt display.