Hello! I have already posted this in another topic but people suggested i should just make a new topic so i just forwarded it here.
So i'm working on two HC05 bluetooth modules where the slave should continuously send a String data to the master automatically. I have a String value which contains 3 variables in it coming each with it's own data types I was able to combine many variables into a String and deserialize them again into individual variables each in their own data types using the ArduinoJson library.
My problem now is that data i want to send from the slave bluetooth to the master one only works when i type out the String in the serial monitor and press the send button from the slave to the master. The data is displayed correctly over on the master's serial monitor. But i want it that the slave would just automate the writing of the String and continuously send it to the master, so i used "println". Then it only displays signs and symbols on the master's serial monitor which is pretty much useless.. here is a snippet of my code:
finalString = String("{\"alcohol\":" + strAlcohol + ",\"lat\":" + strLat + ",\"lng\":" + strLng + "}");
if(Serial.available()){
mySerial.println(Serial.println(finalString));
}
The supposed variables inside the "finalString" are all variables of their own and the "finalString" serves as the String that holds all those variables, to be sent to the master. I just want the "finalString" to be sent automatically to the master bluetooth and deserialize it in there. I am coding this using the ArduinoJson library and that library functions in the way in how i write the String in declaring the "finalString" variable. Anybody have ideas why this code just sends useless signs and symbols? Robin2 suggested i should just use cstrings instead because using String with the capital 'S' corrupts the data to be sent to the master's blueooth due to low memory of arduinos? Any help is much appreciated ![]()