80. Case 76: The Tomato Clock

80.1. Introduction

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.

../../_images/neza-inventor-s-kit-case-76-01.png

80.2. Case building

Assembly steps

Parts List

../../_images/neza-inventor-s-kit-case-76-02.png

The structure is built as shown in the figure:

../../_images/neza-inventor-s-kit-step-76-01.png

../../_images/neza-inventor-s-kit-step-76-02.png

../../_images/neza-inventor-s-kit-step-76-03.png

../../_images/neza-inventor-s-kit-step-76-04.png

../../_images/neza-inventor-s-kit-step-76-05.png

../../_images/neza-inventor-s-kit-step-76-06.png

../../_images/neza-inventor-s-kit-step-76-07.png

../../_images/neza-inventor-s-kit-step-76-08.png

../../_images/neza-inventor-s-kit-step-76-09.png

../../_images/neza-inventor-s-kit-step-76-10.png

../../_images/neza-inventor-s-kit-step-76-11.png

../../_images/neza-inventor-s-kit-step-76-12.png

Connection schematic

In the diagram below, connect the Dust Sensor to the J1 port and the Motor Fan to the J2 port on the Nezha Board.

../../_images/neza-inventor-s-kit-case-76-04.png

80.3. Makecode Programming

Step 1

Click “Extensions” in the MakeCode drawer.

../../_images/neza-inventor-s-kit-case-37-04.png

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.

../../_images/neza-inventor-s-kit-case-37-05.png

*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.

Step 2

Write the program as shown in the figure

../../_images/neza-inventor-s-kit-case-76-06.png

Reference Program

Link: https://makecode.microbit.org/_AY6FuKHFs6H0

You can also download the program directly from the following webpage and start running the program once the download is completed.

Results

Countdown to 25 seconds, the device will play music and lighting effects after the countdown.

../../_images/neza-inventor-s-kit-case-76.gif