I searched now a lot in the forum, but I just have basic programming knowledge.
So here is my problem:
How can I add different boolean status to a new string variable?
I managed to get what I want in a serial.print output - but now I need just that output as a string.
Here Is what I have done so far to get the right output:
you don't need to build up the string for that, print each element separately
hm10.print (String1);
hm10.write('-');
hm10.write(Boolean1 ? '1' : '0');
hm10.write(Boolean2 ? '1' : '0');
hm10.write(Boolean3 ? '1' : '0');
hm10.write(Boolean4 ? '1' : '0');
hm10.write('-');
hm10.println(String2); // or just print if you don't want the CR LF at the end
from a serial port point of view, on the sender or receiver, it's totally the same.
you don't send the data in one piece, you send it character by character (byte by byte - or actually bit by bit) and your baud rate is slow compared to executing the various prints, so there will be no pause on the transmission side due to the fact that you had multiple prints.
But only if you use the correct value for the size parameter and it is all too easy to get that wrong or forget to change it to match the buffer being used. This would be better
Now I ran into another Problem:
The currentPressure variable is a float but I just need the values 1 to 15 coded in the last digit.
So the Last Digit should be like the variable but if it becomes larger than 9.5 it should display "A", >10.5 = B, >11.5 = C, >12.5 = D, >13.5 = E and >14.5 = F
like for a Hex count.
I already tried with if commands and with char but with no success!!
OK - I mean if it's above 16 then the %X will lead to 2 digits being generated and you'll overflow your buffer and then all bets are off (that's why snprintf() was a better recommendation)