Keyestudio magic light cup module is able to interact with ARDUINO. The principle is based on the principle of PWM dimming. The brightness of two modules change.
The mercury switch provides a digital signal and trigger PWM regulation, and then you can see the effect like changing two set of cups full of light through the program design.