Case 76: The Tomato Clock
The Tomato Clock is a clock that uses the tomato work method to manage time, helping one to focus and improve efficiency, and is a great aid to work and study.
The structure is built as shown in the figure:
In the diagram below, connect the Dust Sensor to the J1 port and the Motor Fan to the J2 port on the Nezha Board.
Click "Extensions" in the MakeCode drawer.
In order to program the PlanetX sensor, we need to add an extension library. Search with "PlanetX" in the dialog box to download this library.
Note: If you get a prompt saying that some code libraries will be removed for incompatibility reasons, you can either follow the prompt and continue, or create a new project.
Write the program as shown in the figure
You can also download the program directly from the following webpage and start running the program once the download is completed.
Countdown to 25 seconds, the device will play music and lighting effects after the countdown.