-
Notifications
You must be signed in to change notification settings - Fork 449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'printDigits' was not declared in this scope #421
Comments
A quick web search says that this function might be available in Time library. But there are various versions of the library floating around. So I am not sure. If a library depends on another library, then you have to include both. |
"X was not declared in this scope" usually means you've tried to call a function before declaring it, unlike the IDE which lets you get away with this. if its your own function, make sure to define it before setup() and loop(), if its a library, then be sure to include it at the top of your sketch e.g.
|
that's the thing, notice I put the Time library in:
The Time library is 1.5.0 according the arduino application (which downloaded it in the first place).
I'm using arch linux here, so the arduino app is 1.6.8 :
here's the full output:
repo here: |
hrm, a grep inside my
|
from the looks of your sketch, its just as i said - digitalClockDisplay() is calling printDigits() at line 241 before its been declared at line 252, its nothing to do with the Time library its basic c++, but the ide lets you get away with it as it munges the methods together, the Makefile doesn't so forces you to write correct c++ move lines 252-257 to somewhere before line 238 and i bet it'll fix your problem |
that was it, thanks for that one. Been working with dynamic languages like perl and python too long, I forgot all about that. |
hah, i'm mr. dynamic, been programming perl for 20 years, so strong typing and method declarations were news to me, which is why this solution stuck in my head ;-) |
I'm still laughing that I was grepping around for printDigits everywhere but my own code. And there it is hanging out where I copied and pasted it over a year ago. Doh! |
What library is 'printDigits' in?
I added Time to:
and my compile ends in this:
perhaps I need to include another library like #93 ?
The text was updated successfully, but these errors were encountered: