Detection of saw tooth or square wave

Can you listen to it on headphones or speaker? You can tell what type it is from the sound.

Or do statistical sampling: take N samples of the waveform and see how many "in-between" values there are. If there are fewer than Q, it's a square wave (which should have no "in-between values") else it's a sawtooth.

--
The Ruggeduino: compatible with Arduino UNO, 24V operation, all I/O's fused and protected