Add square wave output support from dmalec in pull #11.