what I'm trying to do is pretty simple, but I've tried almost everything and I simply can't find the solution.
First step:
I have a short variable with the value 40 (example) and I want to convert it to a char (with ASCII code 40).
Second Step:
The second step is to concatenate various results to send via Serial (I really need to send the result in form of a String, since Ii'm using a library). This step is easy, but without the first step I cannot do it with sucess.
That solution worked very well but there is something that I was strugling and I finally found out why. So here is the deal: A char array terminates with '\0', which as the ASCII code of 0. This means that everytime you convert from char array to String if a there's a value with 0 it will terminate the string. Everyone be careful when working with this.
This means that everytime you convert from char array to String if a there's a value with 0 it will terminate the string. Everyone be careful when working with this.
That's one of the reasons not to use the String class.
Of course, whatever it is you are doing probably should be done with byte arrays, not char arrays, so the array processing isn't halted by a NULL.
This means that everytime you convert from char array to String if a there's a value with 0 it will terminate the string. Everyone be careful when working with this.
That's one of the reasons not to use the String class.
Of course, whatever it is you are doing probably should be done with byte arrays, not char arrays, so the array processing isn't halted by a NULL.
That problem doesn't exit with strings, only char arrays (the conversion from char array stops as soon as it finds a '\0' ASCII code 0). Yes, using a byte array might be a solution to this problem, but I still need to use a Sstring since I need to use a function that takes a String for argument.
It's a 485 TDM serial communication protocol made by a friend which he only implemented a function to send information that takes a String from an argument.