I am working on a project in my Arduino, where I want to send several values to a destination through a very slow radio link.
I need to send 7 long
variables, that are 4 bytes each. So rather than converting them to hex strings for up to 64 bytes of data, I would love to store them all in an array, char payload[32];
I tried doing something like this:
long first = 5000;
long second = 10000;
char payload[8];
long* pointer;
pointer = &payload[0];
*pointer = first;
pointer = &payload[4];
*pointer = second;
But I get hit by a conversion error.
What is the proper way of doing this?