... Always More! ;) Width modulation added, with it you can achieve ramp down/up, pseudo sine(this is not true sine) and many more from a single triangle waveform:   // calc an unipolar triangle(0 to 65535) depending on x(time) between 0 and 65355 and phase between 0 and 65355 // set the phase u16 time = (u16)(x + phase + (u16)(wide_mod/2)) ; // apply pos/neg width modulation, wide_mod is an unsigned 16bit ;) float wide_pos = 65535.0/wide_mod; float wide_neg = 65535.0/(6553