Function generator via Arduino code (sawtooth, sine, and square wave)

consider using a DDS device such as the AD9833 Programmable Waveform Generator
there are examples using an arduino microcontroller