A code switch is a digital input switch that outputs a binary code signal based on the mechanical position of the switch. Rotation of the knob drives the adjustable encoder disc and encoder plate via the switch handle, recording the angular change of the knob. Different binary codes are marked on the adjustable encoder disc and encoder plate. When the switch is operated, pressing the button causes the adjustable encoder disc and encoder plate to rotate together. The contacts on the encoder plate engage with the wires on the adjustable encoder disc, outputting corresponding control signals based on the connected binary code to achieve the switch control function.