Step 0. Using your web browser, go directly to to land the MakeCode for micro:bit home page. You can bookmark this package to easily open this package for next project. In the My Projects section, click on the New Project

For more information about MakeCode, please go to our tutorial: What is MakeCode

Step 1. In the Toolbox, click Led category and then more. Drag and drop led enable false  block over and place it inside on start block

Step 2. In the Toolbox, click on the Pins category under Advanced.

Step 3. Click on the Pins category and drag and drop the digital write pin P0 to 0 block over and place it inside the forever block.

Step 4. Choose P7 from the drop-down menu, and change “to” value from 0 to 1 as following picture:

Step 5. In the Toolbox, click on the Basic category, click and drag the pause(ms) block over and place it inside of the forever block, and choose 1000ms as following figure:

Step 6. Right click digital write and pause block, then select Duplicate  to copy these two blocks as following.

Step 7. Change   new digital write block ‘to’ value from 0 to 1, and place these block inside forever block

Step 8. rename the project   and download it as following.

Step 9. Download this “.hex” file and send it to your MICROBIT disk.

Below is the full program we have done for you as reference:

Complete wiring and power with 5V, You will see the LED turn on for 1s and then turn off for 1s, and you will hear “da,da” sound from relay.