Sawtooth Waveform


Users of the ATmega328 based Arduino boards will recognize that the analogWrite() function doesn’t actually do anything analog.  It just sets the duty cycle of a pulse width modulated (PWM) signal.  The (new) Arduino Due board, which I have had limited time to play with, actually sports two Analog DAC channels. Using a very simple for() loop, it is possible to generate a sawtooth waveform using these channels.