I am trying to write an adruino library but keep getting hung up on errors requiring me to include header files. I have run into one that I can't find the header file for. I keep getting the error:
...file.cpp:23: error: 'delay' was not declared in this scope
Line 23 of my .cpp file is:
delay(10);
Any help would be greatly appreciated. Thank you.
If you are using a version of the Arduino software prior to 1.0 (with a version number of the form 00XY, e.g. 0023) you need to include WProgram.h
in your .cpp files.
If you are using 1.0 or above include Arduino.h
instead (the header file was renamed in that version).
change
#include "WProgram.h"
to
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
in the offending .h header file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With