i am using the virtual wire library which can be found at http://www.airspayce.com/mikem/arduino/ here is a snippet of the code that is relevant.
const char *msg = "hello"; vw_send((uint8_t *)msg, strlen(msg)); // command to send the data vw_wait_tx();
msg can hold upto 27 bytes of data as per the documentation of the library. what i would like to do is manipulate each of the bytes separately so lets say we write some code like
int b1 = 0x01; int b2 = 0xa0; int b3 = 0xFF; and so on.
all of those values will be manipulated elsewhere in the code. would it be possible to pass all the values from b1 to b27 into msg ? so that i can send all the information in one go using
vw_send((uint8_t *)msg, strlen(msg));
here is what i am trying to do, so you can better understand and guide me. I wish to have 3 transmitter and 2 reciever, they will be transmitting at different intervals. when the data is transmitted, on the receiver end, i want to be able to understand where this data came from and where it needs to go.
so transmitter 1 when trying to contact receiver 1 would send something like
0x01 0x01 followed by the data
trasmitter 2 when trying to contact receiver 1 would send something like
0x02 0x01 followed by the data
and on the receiver side and i can use an if statement and check the first byte and understand, this data is coming from transmitter 1 or transmitter 2.