Buffer variable after transfer

Hello,

I have built a radio transmission via NRF24L01. Now a message is always transmitted as a string.

At the recipient, I would like to cache the message in a variable so that I can output it until the next transmission.

How do i do this?

Many thanks for your help.

Greetings
Martin

@martinm1996

Your topic was Moved to it's current location / section as it is more suitable.

Could you also take a few moments to Learn How To Use The Forum.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.

Code? circuit?

martinm1996:
I have built a radio transmission via NRF24L01. Now a message is always transmitted as a string.

Is it? Why?
Usually it is much easier to transmit the data as a sequence of bytes in its raw form.
Saves all the translating to and back from a string at both ends.

At the recipient, I would like to cache the message in a variable so that I can output it until the next transmission.
How do i do this?

Create a variable, store the received data in the variable, output the variable???

Maybe Robin's Simple nRF24L01+ 2.4GHz transceiver demo can give you some ideas.

@MarkT: Unfortunately my code is too long to post here. The circuit diagram is also too complex.

@pcbbc: Okay. My broadcast chain is currently sending this out as a string. How do I send this as a byte sequence?

You have to imagine it like this. Every 10 seconds I send a data packet as a string. This data packet is only visible to the receiver for 1 second. The remaining 9 seconds the data packet can be shown in the 0.96 inch display, since it resets the display text every 500ms. I need my data packet until the next one arrives. Greetings Martin

martinm1996:
@MarkT: Unfortunately my code is too long to post here. The circuit diagram is also too complex.

Post a minimal compilable example then.

@pcbbc: Okay. My broadcast chain is currently sending this out as a string. How do I send this as a byte sequence?

typedef struct {
  int value1;
  byte value2;
  ....
} PACKET;

PACKET packet;
RF24 radio(?,?);

packet.value1 = ????;
packet.value2 = ??;
radio.write(&packet, sizeof(packet));

This data packet is only visible to the receiver for 1 second. The remaining 9 seconds the data packet can be shown in the 0.96 inch display, since it resets the display text every 500ms. I need my data packet until the next one arrives.

That leaves so many questions unanswered, sorry. We need to see code.

If you receive the data (I have no idea what "visible to the receiver for 1 second" means) then store that data in a global variable. That global will then be available to the rest of the program until the next packet of data is received and updates the global variable.

Why reset the display text every 500ms if you are only receiving data every 10 seconds? The simple answer (without seeing the rest of your code of course) is only reset the display text when you receive new data. There's no point doing it otherwise.