void value not ignored as it ought to be

i am making a wireless fire and tempratur system while on receiver side the code says void value not ignored as it ought to be i am new to coding where the error is i am stuck at finding out.

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include <DHT11.h>
#include<LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 20, 4);


float temperature[2];

RF24 radio(8, 9);
const uint64_t pipe = 0xE8E8F0F0E1LL;

void setup(void)
{
  Serial.begin(9600);
  lcd.setCursor(0, 2);

  radio.begin();
  radio.openReadingPipe(1, pipe);
  radio.startListening();


  lcd.print("Humidity & temp");
  delay(2000);
  lcd.clear();
  lcd.print("Starting.....");
  delay(2000);
}

void loop(void)
{
  if ( radio.available() )
  {
    bool done = false;
    while (!done)
    {
      done = radio.read(temperature, sizeof(temperature));
      lcd.clear();
      delay(500);

      lcd.setCursor(0, 0);
      lcd.print("Temp");
      lcd.setCursor(0, 1);
      lcd.print("Humidity");
      lcd.setCursor(9, 0);
      lcd.print(temperature[0]);
      lcd.print(" C");
      lcd.setCursor(9, 1);
      lcd.print(temperature[1]);
      lcd.print(" %");
      delay(1000);
    }
  }
  else
  {
    lcd.setCursor(0, 0);
    lcd.print("No radio Found");
  }
}
void setup(void)

...
void loop(void)

No need for "void" between the parenthesis, change that to:

void setup()
 ...
void loop()

i removed the void but the error still exists

Weird, I can compile it without errors! After removing all references to nRF24L01.h, RF24.h and DHT11.h that is, because they don't exist on my PC.

My guess is there's a hiccup somewhere... Try this: save your sketch, close the IDE, open it again and load your code again.

Erik_Baas:
No need for “void” between the parenthesis, change that to:

void setup()


void loop()

It doesn’t hurt

Instead of done = radio.read(temperature, sizeof(temperature));

Try radio.read(temperature, sizeof(temperature));

Are you sure that sizeof is correct?

TheMemberFormerlyKnownAsAWOL:
It doesn't hurt

Instead of done = radio.read(temperature, sizeof(temperature));

Try radio.read(temperature, sizeof(temperature));

Are you sure that sizeof is correct?

yes sizeof is correct

Are you mixing different versions of libraries?
The version of RF24 that I have (but haven’t used/updated in years) has the read method as void.