title: making arduino receive data from nRF24 (SPI and nRF libraries) while reading the serial port waiting for a data request using serialcommand
body: <p>I am able to transfer data from one arduino to another using nRF24L01 chips. However, I need the data to be sent ONLY when a specific command is sent on the serial port. I want to be able to write 'A' on the serial port, and for arduino to reply with the latest data. This is easy with the serialcommand library and works if I am directly plugged in. However, the moment I add the nRF24L01 module, serialcommand.h does not respond with the data anymore. I tried even removing the if (radio.available()) .. so no data would be received and just the fact that there is radio.begin() in setup makes the serialcommand 'A' not work. when I remove the radio stuff, the command 'A' does reply with three zeros (default data).</p>
  
  <p>Here is my receiver code. I still consider myself a beginner and i never formally studied C/C++. Any help or ideas as to why this happens is very appreciated!</p>
  
  <pre><code>.
  #include &lt;SoftwareSerial.h&gt;
  #include &lt;SerialCommand.h&gt;
  #include &lt;SPI.h&gt;
  #include &lt;nRF24L01.h&gt;
  #include &lt;RF24.h&gt;
  
  SerialCommand sCmd;
  
  RF24 radio(7, 8); // CE, CSN
  
  const byte address[6] = "00001";
  
  int Array[3];
  
  void setup() {
  
  Serial.begin(9600);
  sCmd.addCommand("A", serialdataPrint );
  radio.begin();
  radio.setRetries(15, 15);
  radio.openReadingPipe(0,address); 
  radio.setPALevel(RF24_PA_MIN);
  radio.startListening();
  
  }
  
  void loop() {
  
     while (Serial.available() &gt; 0){
      sCmd.readSerial();
  
      if (radio.available()) {
  
      int Array_received[3];
  
      radio.read(&amp;Array_received, sizeof(Array_received));
  
      Array[0] = Array_received[0];
      Array[1] = Array_received[1];
      Array[2] = Array_received[2];
      } 
    }
  }
  
  
  void serialdataPrint ()
  {
      Serial.println(Array[0]);
      Serial.println(Array[1]);
      Serial.println(Array[2]);
  }
  
  </code></pre>