added square wave and gain adjustment to mouse controller