Function generator with Arduino Nano
The PWMs on pins 10 and 11 of the Arduino Nano run at 488 Hz. That's what you are seeing on the scope. The code you are using was meant for an Arduino Due, which has real digital-to-analog converters.

Edit: You can tune the PWM to run as high as F_CPU/256 by
reconfiguring the timers 1 and 2 to “fast PWM” mode, instead of phase
correct PWM, and setting their prescalers to 1 instead of 64. This
should raise the PWM frequency to 62.5&nbsp;kHz, given that the Nano has
a 16&nbsp;MHz clock.

The following code should do exactly this. You can put it somewhere
inside your setup(). Warning: I have not tested this code. This
will change the PWM frequency on pins 10 and 11, but also on pins 3 and
9, which share the same timers. It will probably break the tone()
Arduino function.

// Set PWM frequency to 62.5 kHz on pins 3, 9, 10 and 11.
TCCR1A = 1&lt;&lt;WGM10;
TCCR1B = 1&lt;&lt;WGM12 | 1&lt;&lt;CS10;
TCCR2A = 1&lt;&lt;WGM21 | 1&lt;&lt;WGM20;
TCCR2B = 1&lt;&lt;CS20;