I'm pretty new to Arduino. I've got a little bit of coding experience but none in C++. Just some Python and pretty good with Matlab, both self taught so my code might not exactly follow best practices (feel free to point out any of those issues too, I'm still learning as I go).
For some reason when I run it I get the following error that's gotten the best of me:
...MCP7940MRTC.cpp:155:34: error: 'dec2bcd' was not declared in this scope
b[0] |= dec2bcd(tm.Second & 0x7f); // stop the oscillator and write the data
The codes too long to post so I've attached the .h and .cpp below. If it's easier I can post snippets.
Thanks in advance for any help, this one's really got me.
The error gives the file and line where the error occurs (MCP7940MRTC.cpp line 155) so I just downloaded the file and had a look in that general area. I've definitely had a good bit of experience spotting bugs over my years working on the Arduino project, as well as my own code. I've might have done something like this myself a couple times.
It's definitely helpful to have a general understanding of C++. Otherwise it would be easy to get stuck on thinking "The declaration is right there in the .h file, so why the heck am I getting this error?". You will rarely see classes implemented in Arduino sketches but they're used in practically every Arduino library. Once you dive into libraries it's worth studying up on them and writing some simplified test programs to make sure you got it.
Ya, working my way up to self sufficiency - thanks for lending your experienced eyes, probably would've spent a few more hours on it before giving up, then looking again a few days from from now and finally having it pop up at me (or not...)