title: How can we measure data transmission rate in Arduino for nrf24l01 module?
body: <p>These Arduino codes developed for nRF24L01 module. It's an RF module which provides wireless communication between 2 points. And my purpose is to measure the data transmission rate between these 2 points. </p>
  
  <p>This is the example of transmitter code:</p>
  
  <pre><code>#include &lt;SPI.h&gt;
  #include &lt;nRF24L01.h&gt;
  #include &lt;RF24.h&gt;
  RF24 radio(7, 8); // CE, CSN
  const byte address[6] = "00001";
  void setup() {
    radio.begin();
    radio.openWritingPipe(address);
    radio.setPALevel(RF24_PA_MIN);
    radio.stopListening();
  }
  void loop() {
    const char text[] = "Hello World";
    radio.write(&amp;text, sizeof(text));      
  }
  </code></pre>
  
  <p>This code basically sending a string which is "Hello World" over the channel. First I'm calling some libraries related with module. Than I'm defining the pin numbers that module uses. Than I'm naming the module. After that some properties such as listening mode and power level of the module set. And finally message send over the loop. Also receiver code is provided below:</p>
  
  <pre><code>#include &lt;SPI.h&gt;
  #include &lt;nRF24L01.h&gt;
  #include &lt;RF24.h&gt;
  
  RF24 radio(7,8);
  
  const byte address[6] = "00001";
  void setup() {
  
  
    radio.begin();
    radio.openReadingPipe(0,address);
    radio.setPALevel(RF24_PA_MIN);
    radio.startListening();
    Serial.begin(9600);
    // put your setup code here, to run once:
  
  }
  
  void loop() {
  
    if (radio.available()){
  
      char text[32] = "";
      radio.read(&amp;text,sizeof(text));
      Serial.println(text);
  
    }
  
    // put your main code here, to run repeatedly:
  }
  </code></pre>
  
  <p>Receiver logic is same as the transmitter. </p>
  
  <p>All in all, the question is how can we measure the data rate as bit per second for this wireless communication? </p>