In the C51 single-chip microcomputer, it is also very important to control whether the light is turned off or on through the buttons. In addition, it is also necessary to make good use of the anti-shake function of the buttons. The implemented code is as follows. In addition, I once again used the pointer wrapper function to exchange the values of two variables.