I found a library for the MCP6725 DAC which (I think) contains the functions I need. The library is at Arduino/libraries/MCP4725 at master · RobTillaart/Arduino · GitHub. There appears to be be no .zip file, so I copied the contents of the individual files (.H, .ccp, .json, .properties) to my PC and Zipped them, then added them as a library in the arduino editor. The library is called "MCP6725".
The example files compile OK, so I assume the library is good.
However there's something I don't understand. The example files contain statements such as the following:
The DAC.writeDAC function is the one I need. If I remove the #ifdat and #endif statements, then there's a compilation error that tells me 'class MCP4725' has no member named 'writeDAC'. Presumably the program doesn't attempt to execute the function with #IFdef in place because it hasn't been defined and so there's no compiler error? Just a guess here.
Some functions are fine, such as "DAC.setValue(200)", so "setValue" is a member of the class and the library works fine for that.
It seems there are a set of functions which compile without issues, but there are some "extended" functions which don't and I can't figure out how to enable these extended functions.
Looking at the .cpp file, it too has lines like
It seems like there should be a switch to turn on these "_EXTENDED" functions but I can't figure out how to do that. There also seems to be a set of functions preceded by:
which define a further set of functions (if enabled??).
I hope this explanation of my problem is clear enough to understand what I'm asking about. Obviously there's something about libraries or functions or extended library functions I don't understand.
Any help or pointers would be greatly appreciated.