Basic square wave functionality