- which Arduino are you using?
- This line is confusing:
const int analogOutPin = DAC0; // Analog input pin that the potentiometer is attached toobviously you are using it as an output, so why the comment?
- on most Arduinos, 'double' is the same as 'float' so if you're expecting/need double precision, you aren't getting it.
@gardner. The asin is correct in this case. It is generating a triangle wave.