But the issue is still the same : at first it's fine, the voltage goes from 0 to 5V, then decreases from 5V to 0V, but then jumps to 5V again, decreases to -5V and increases to 5V. Here is my code.
I have no clue how that is happening.
I think it is time to put in some debug prints to see if it is the code or the DAC that is going wonky. Fortunately that is something I can try on my Arduino here.