Alarm was not declared in this scope


I am trying to sort some code out for a wireless weather station connected to a base station using the NRF24L01 device.

I try to verify the code that I have but it keeps responding to me with alarm was not declared in this scope and highlighting the following passage.

attachInterrupt(0, alarm, FALLING); // setting the alarm interrupt

I have also attached the entie code for reference.

Any help is greatly appreciated.

Cooper_station.ino (10.9 KB)

Do this:

  • Tools > Auto Format
  • Examine the indentation of your code. You will find that, starting with the loop() definition, the indentation is not as expected. This indicates that you are missing a brace somewhere above that point.
  • Once you have fixed the code, do another Auto Format and examine the indentation again to verify that it is as expected.
  • Try compiling again. If you have a problem the post the FULL error output.

When you encounter an error you’ll see a button on the right side of the orange bar “Copy error messages”. Click that button. Paste the error in a message here USING CODE TAGS (</> button on the toolbar).

   dataString += dustDensity;, sizeof(unsigned long) );

I don't think so !

You forgot the '}' at the end of setup(). And at the end of loop(). And you put an extra '}' after FindWindDir().