I'm using arduino several month now, And i don't understand when i can use the arduino object of String. I'll explain, I read a lot and the it's look like that this object is a good way to read/write and use strings, But everywhere they say that this object take a lot of RAM. So i made some project, And almost in all of them the String object not work as i expected. When i check the RAM in my projects i see that when my usage of RAM is greater then 65% the string object start to do problems. Because of this i stop use the string object and use only char arrays.
So my question is:
- How can i know when i can use String from the beginning?
- there is a way to change from char array to string or vase versa easily (i know this is completely different logic)?
- How can i avoid the memory problems with the String object?
All this questions come from that the String object is very effective and easy to use and i want to use it, But i'm fear from RAM problems so i'm not using it.
Thank you very much for reading all this, Hope you can help me!
String
. The linked answer provides all (good) reasons for that.String
usage is generally bad, except if you do simplistic projects and only for fun. I NEVER useString
(and never will).