Go Down

Topic: RF24 Network, - Save to variable (Read 336 times) previous topic - next topic

Jimster

I've been trying to work this out for a few days, but I'm still stuck. It would be amazing if someone could help me

I'm using the sensornet example, but I'm trying to write the data from sensors into a variable.

I guess I'm correct in thinking this is the code that write the data via serial

Code: [Select]
RF24NetworkHeader header;
   S_message message;
   network.read(header,&message,sizeof(message));
   printf_P(PSTR("%lu: APP Received #%u %s from 0%o\n\r"),millis(),header.id,message.toString(),header.from_node);


Can someone breakdown whats going on above so I can work out whats going on??

currently the above ouputs
"492136: APP Received #340 247.61 /226.31 from 01"

What I'd like to do is import the data into two arrays, "temp_read" and "voltage"

I've tried removing the code" %lu: APP Received #%u %s from 0%o\n\r" but this doesn't work.

Thanks in advance

Jim

Jimster

I've worked out that the data is already stored in the variable message.toString(), The data held in the string is "223.16 /203.39"  now I need to break the string into two variables, before and after the forward slash

Go Up