I'm pretty sure making any decent triangular wave is beyond the Mega's capability without additional hardware.