![]() ![]() Then I convert to a Char array and try and send it. String FULLMESSAGE = String(string1 + string2 + string3 + string4 + string5) ![]() so I have to tie them together into one string. I do this for each of my variables giving me the String binarytemp along with others like "binarypressure" and "binaryswitch". So I convert to binary using this bit of code I found here: float temperature //define temperature as a floatīmp.getTemperature(&temperature) //assign the value to tempriture So I needed to convert my integers into binary and then the binary into char arrays to send it. ![]() I think vw_send only sends char arrays.? (I'm a bit rusty on my terminology) The issue is, for all our devices to work together they need to be sending the same kind of "packet" and we have been told that it needs to be sent as binary. That code works fine, it sends the data and its received on the other end like so (left is transmitting right is receiving). Vw_wait_tx() //Waits for message to be sent Vw_send((uint8_t *)fullmsg, strlen(fullmsg)) //Sends full message via virtualwire I have this working in decimal fine using this bit of code: Serial.println("Attempting to send.") other bits and bobs are being sent too, like an ID for the transmitter so the receiver knows what it is (the idea is we all make a transmitter and they can all talk to 1 receiver and all the transmitters have different ID's) The main data I'm sending is being read from a temperature/pressure sensor. I have an assignment for a uni course that requires me to send a "packet" of data from one arduino to another using cheap radio transmitters and the I've spent a few days stuck on this one so I thought id seek some help! I'm fairly new to programming and am having some real issues. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |