how I can determin connection state between nRF24L01 TX & RX

hi every one :)

I want to turn on an led in transmitter circuit when connection between transmeter and reciever is work, and turn off the led if the connection loss

I have two arduino and want to make the on/off code for the transmitter not for the reciever :confused:

Just insert the code between lines 112 and 113.

Oh, you did not post the complete code in code tags, too bad.

ZeRo-ErRoR: I want to turn on an led in transmitter circuit when connection between transmeter and reciever is work, and turn off the led if the connection loss

A message between a pair of nRF24s takes no more than a few millisecs. You won't be able to see an LED lighting for that length of time. There is no such thing as a connection between the Tx and Rx except for that few millisecs.

If what you want to do is detect when transmissions fail the simple way is to send a message at regular intervals - perhaps 5 times per second - and then by timing the interval since the last message the receiver will know when the transmissions cease.

...R Simple nRF24L01+ Tutorial

Robin2: There is no such thing as a connection between the Tx and Rx except for that few millisecs.

A full sized packet (2 MBit) just took 528 µs from send to transmit interrupt, including the acknowledge (without payload).

Whandall: A full sized packet (2 MBit) just took 528 µs from send to transmit interrupt, including the acknowledge (without payload).

Even harder to see an LED that is only ON for that period :)

...R

Robin2: A message between a pair of nRF24s takes no more than a few millisecs. You won't be able to see an LED lighting for that length of time. There is no such thing as a connection between the Tx and Rx except for that few millisecs.

If what you want to do is detect when transmissions fail the simple way is to send a message at regular intervals - perhaps 5 times per second - and then by timing the interval since the last message the receiver will know when the transmissions cease.

...R Simple nRF24L01+ Tutorial

I mean I want to know when it's always connected and not just at the moment I connect, I mean that the LED stays work while the connection is available .

Keep in mind that I want the LED in the transmitter circuit and not the receiver.

Whandall: Just insert the code between lines 112 and 113.

Oh, you did not post the complete code in code tags, too bad.

Do you have a thinking mind? I said I want code and not correct my code. So if you want to make fun of someone, you must first understand the question so that you do not put yourself in an awkward situation.

Hi,

ZeRo-ErRoR: Do you have a thinking mind? [u]I said I want code and not correct my code.[/u] So if you want to make fun of someone, you must first understand the question so that you do not put yourself in an awkward situation.

Then you are in the wrong section of the forum. Try Gigs and Collaborations. Can you tell us your electronics, programming, Arduino, hardware experience? Tom.... :)

ZeRo-ErRoR: I mean I want to know when it's always connected and not just at the moment I connect,

I do wish people who ask questions would read the answers they receive - in this case the piece you quoted.

Let me repeat, a pair of nRF24L01+ modules are NOT always connected. The concept is meaningless.

...R

ZeRo-ErRoR: Do you have a thinking mind?

Absolutely.

ZeRo-ErRoR: I said I want code and not correct my code.

The normal way to get a working program is by writing it, alternatively you could try to pay someone to fulfill your wishes.

ZeRo-ErRoR: So if you want to make fun of someone, you must first understand the question so that you do not put yourself in an awkward situation.

If you say so.

Ignoring the forum rules (Read this before posting a programming question... section 6. Getting help on the forum), wishing impossible things and not understanding the used hardware is more awkward IMHO.

Good luck with your project.

I found the soluation :slight_smile:

check if the data send or no using this code :

radio.write( data, sizeof(data));

 bool ok = radio.write( data, sizeof(data));

  if(ok){
 digitalWrite(22,HIGH);   // led pin
  }

else if(!ok){
 digitalWrite(22,LOW);    // led pin 
  }

ZeRo-ErRoR: I found the soluation :)

Exactly as in my tutorials in the link in Reply #2

...R