The invention provides a knob dimming method which comprises the following steps: S1, when a falling edge is detected in each interruption of a program, performing input falling edge interruption on a pin A, and then starting a
timer; s2, judging whether the timing time of the
timer is up or not, if not, returning to S1, and if so, reading the
signal level of the pin A; and S3, judging whether the
signal level of the pin A read in S2 is a low level or not, if not, returning to S1, and if so, judging that the level of the pin A is valid. According to the invention, the effective level can be rapidly obtained after the level recovers to be stable, the maximum
delay time or
pulse period is not measured again by means of device replacement, the knob level is read by dynamically setting timing, misjudgment is greatly avoided, and in addition, the problem of pulse
signal counting coverage caused by
rapid rotation of the knob is also solved.