Some help with Const Char, please...

On a sketch, for using SoftwareSerial (now Radiohead?), I found these lines:

const char *msg = "hello"; uint8_t buf[VW_MAX_MESSAGE_LEN]; uint8_t buflen = VW_MAX_MESSAGE_LEN;

These send the string "hello" over a transmitter to a receiver.

But... I want more. I want to sent, let's say, a number, a "counting" number every single second. Or other data over that transmitter.

Anyone an idea how I have to change that code?

Marecdl: On a sketch, for using SoftwareSerial (now Radiohead?), I found these lines:

const char *msg = "hello"; uint8_t buf[VW_MAX_MESSAGE_LEN]; uint8_t buflen = VW_MAX_MESSAGE_LEN;

These send the string "hello" over a transmitter to a receiver.

No they don't.

Anyone an idea how I have to change that code?

Drop the const, if you want to be able to change the text.

Make it a real array if you want to be able to programmatically make changes.

char buffer[80];

int temp=30;
int humid = 80;

sprintf(buffer, "Temp: %d; Humid: %d", temp, humid);

Then, send buffer, using strlen(buffer) to define the length.

If the compiler complains, lie to it:

   vw_send((const char *)buffer, strlen(buffer));