NRF24L01 CODE ERROR

Hello

I was trying to compile code for nrf24l01 transmitter. but i am getting some error.

can someone please help me to solve this error

error message
Arduino: 1.8.7 (Windows 7), Board: “Arduino/Genuino Uno”

The sketch name had to be modified.
Sketch names must start with a letter or number, followed by letters,
numbers, dashes, dots and underscores. Maximum length is 63 characters.

C:\Users\IFTech\Documents\Arduino\new_tra\new_tra.ino: In function ‘void loop()’:

new_tra:26:11: error: void value not ignored as it ought to be

done = radio.read(msg, 1);

^

Multiple libraries were found for “nRF24L01.h”
Used: C:\Users\IFTech\Documents\Arduino\libraries\RF24
Not used: C:\Users\IFTech\Documents\Arduino\libraries\NRFLite
Not used: C:\Users\IFTech\Documents\Arduino\libraries\NRFLite
Not used: C:\Users\IFTech\Documents\Arduino\libraries\NRFLite
Not used: C:\Users\IFTech\Documents\Arduino\libraries\NRFLite
exit status 1
void value not ignored as it ought to be

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.

#include <nRF24L01.h>
#include <printf.h>
#include <RF24.h>
#include <RF24_config.h>



int msg[1];
RF24 radio(9,53);
const uint64_t pipe = 0xE8E8F0F0E1LL;
int LED1 = 13;     // led pin 13
int LED2 = 5;     

void setup(void){
 Serial.begin(9600);
 radio.begin();
 radio.openReadingPipe(1,pipe);
 radio.startListening();
 pinMode(LED1, OUTPUT);
 pinMode(LED2, OUTPUT);}

void loop(void){
 if (radio.available()){
   bool done = false;   
   while (!done){
     done = radio.read(msg, 1);     
     Serial.println(msg[0]);
     if (msg[0] == 111){delay(10);digitalWrite(LED1, HIGH);}
        if (msg[0] == 222){delay(10);digitalWrite(LED2, HIGH);}
     else {digitalWrite(LED1, LOW);}
     delay(10);}}
 else{Serial.println("No radio available");}}

Isn't this just more of the same problem in your other Thread?

Pleas click Report to Moderator and ask to have them merged so we have all your info in one place and so we don't repeat advice you have already received.

...R

You are using a very crappy ManiacBug example with a newer/better library.

Do not use these examples, start with Simple nRF24L01+ 2.4GHz transceiver demo.

Robin2:
Isn’t this just more of the same problem in your other Thread?

Probably, another try to get away with copy and paste.

But there is no use in joining the threads, I think.

Whandall:
But there is no use in joining the threads, I think.

You are already duplicating effort in your Reply #2 by giving him the link I already gave him in Reply #1 in the other Thread.

That's why I won't waste my time reading two Threads on the same problem.

...R

Hello

Guys please. I need to solve this error. if there is any solution like if i need to update any library please let me know.

here is the code. i need to compile this code without error.

#include <SPI.h>                       // SPI Arayüzünü dahil ettik.
#include "RF24.h"                      // RF24 kütüpanelerini dahil ettik.
byte data[1];                          // Göndereceğimiz data değişkenini oluşturduk.
boolean var;                           // Bit şeklinde var değişkeninini oluşturduk.
const uint64_t pipe = 0xF0F0F0F0A1LL;  // Paralel veri yolu adresleri tanımlamasını yaptık.
RF24 radio(9,10);                      // Modülün CE pinini 9.pin CS pinini de 10.pine bağlayacağımızı belirttik.

void setup(){
 pinMode(3, OUTPUT);                    // Arduino'nun 2.pinini çıkış olarak ayarladık.
 pinMode(5, OUTPUT);                    // Arduino'nun 4.pinini çıkış olarak ayarladık.
 pinMode(7, OUTPUT);                    // Arduino'nun 6.pinini çıkış olarak ayarladık.
 radio.begin();                         // Kablosuz iletişimi başlattık.
 radio.openReadingPipe(1,pipe);         // Veri alacağımız kanalın ID'sini tanımladık.
 radio.startListening();                
}

void loop(){
 if(radio.available()){
   var = false;
   while(!var){
     var = radio.read(data, 1);   
      if(data[0] == 0){
      digitalWrite(3, LOW);
      digitalWrite(5, LOW);
      digitalWrite(7, LOW);
      }
      if(data[0] == 1){
      digitalWrite(3, HIGH);
      }
      if(data[0] == 2){
      digitalWrite(5, HIGH);
      }
      if(data[0] == 3){
      digitalWrite(7, HIGH);
   }
  }
 }
}

bmg1234:
Guys please. I need to solve this error.

Let's turn this around.

You want help which people are willing to give you for free. So how about helping us to help you by responding to the advice and comments you have already received?

...R