So you get the error message “Timer1 was not declared in this scope” when you are compiling a program for your Arduino and you dont know what the problem is. You copied a program from the internet and everyone says it works, but you can’t seem to get it to work.
You check the code and yes, the ‘TimerOne’ library is declared, and it can be found, so why doesnt it work?
Well, there could be several reasons, but it could well be that your TimerOne library is out of date:
here is what you do:
Make sure your TimerOne.h file contains:
extern TimerOne Timer1;
and that your TimerOne.cpp file contains:
TimerOne Timer1;
If not, update the TimerOne library. A good source would be here.
Also, if you are using a Teensy, it seems that for some time the TimerOne library wasn’t ported for the Teensy, but that seems to be fixed now as well.
Worked like a charm,,,,!.After updating the TimerOne Library
Happy to be of service
hi. Im.stumped. i followed ur instructions and I am still getting the error timer1 was not declared. ? any ideas. i downloaded and unzipped into libraries and its there
what now
your help would be greatly appreciated
ok that is too bad. What is it exactly that you have done? Did you update the timer?
not sure if you had success now. just check if the old timerone files were indeed replaced
me too. i already update and follow the instruction , but still get an error. please kindly help me to solve the problem. do pm me at azimredblueeyes@ymail.com
problem happened:
`Timer1` does not declared in this scope
can u check your cpp and h files to see if they indeed updated?