DAC-ADC Code
You can find the most up-to-date arduino code stored in Github:
Note: This code uses the Standard Template Library (STL), which you can find in this website: The Standard Template Library (STL) for AVR with C++ Streams. This seems to work pretty easily for Due, but if you are using a Mega for some reason, it’s harder. Adding includes to the code in this order, formatted like the existing code for vector alone, seems to work (at least in IDE 1.6.13): iterator, vector, serstream, pnew.cpp . Useful updates to this library may eventually be here.