I'm working with an UNO and I'm using maniacbug's RF24 library with soft spi, and his rf24network library. https://github.com/maniacbug/RF24Network
All I'm trying to do is send data but I'm stuck with the wrong data type.
{
last_sent = now;
printf("Sending...\r\n");
const char* hello = "Hello, world!";
RF24NetworkHeader header(/*to node*/ other_node);
bool ok = network.write(header,hello,strlen(hello));
if (ok)
printf("\tok.\r\n");
else
{
printf("\tfailed.\r\n");
delay(250); // extra delay on fail to keep light on longer
}
}
If I change it to
bool ok = network.write(header,myString,strlen(myString));
I get an error on data type. So how do I get my string to fit this structure. My thought was to to a myString.toCharArray then maybe loop through that?
Convert the String into a char array first:
and then you can pass
buf
: