I am attempting to use the AdvancedSerial library "GitHub - renatoferreirarenatoferreira/ebl-arduino: Automatically exported from code.google.com/p/ebl-arduino". The onReceive serial string appears to work just fine. However I have not been able to form a proper string for the send method. I just don't understand pointers and arrays well enough. There is only a sample sketch using the :onReceive" method and not the "send" method. Does anyone have a simple sketch for preparing a string for the "AdvancedSerial.send" method of this class?
Does the 23 mean anything or could I make the ID anything I want. I'd like the id to indicate which Arduino needed to perform which action.
Also I am totally lost! I have
string "Temperature: "
float "temp_f" which I want as string "xxx.xx" first x is ' ' or '-'
string "FHumidity: "
float "humidity" which I want as string "xx"
string "%"
Which I want to make into a long string, so I send "Temperature: xxx.xxFHumidity: xx%" to the other side. I have not been able to convert the float into strings like xxx.xx or xx! So what I want is:
I have not been able to convert the float into strings
dtostrf() to the rescue.
id = destination address(A,B,C etc)-operation(1,2,3 etc) ie. A1 or C3
id is a byte. You need to be careful what you are trying to stuff into it. 0xC3 is not the same as "C3".
I'm getting a lot of errors so I need to tackle this a little bit at a time.
Yes, you do. If needed, post the code and the errors. This isn't rocket surgery. It just takes a little common sense to convert the values to the string you want.