Connect green LED lamp with OSOYOO expansion board for Micro:bit P0 with 3pin wire ;
connect yellow LED lamp with OSOYOO expansion board for Micro:bit P1 with 3pin wire ;
connect red LED lamp with OSOYOO expansion board for Micro:bit P2 with 3pin wire as below;
Step 1. In the Toolbox, click on the Pins category and then click the digital write pin to button, and then Drag and drop the digital write pin to block inside the forever block.Choose the value to 1 .
Step 2.Click on the Basic category. Then click and drag the pause (ms) block over, and place it inside the on Start block ,and writed 5000 in the pause (ms) block over .
Step 3. Click Duplicate from the digital write pin to block over . You will get a duplicated block ,and place it inside the on Start block .change the value 1 to 0 .
Step 4. In the Toolbox, click on the loops category and then click the repeat times do button, and then Drag and drop repeat times do block inside the forever block. Writed the times to 3.
Step 5..Click on the Basic category. Then click and drag the pause (ms) block over, and place it inside the on Start block ,and writed 500 in the pause (ms) block over .
Step 6.Click Duplicated three times from the digital write pin to block over and pause(ms ) block over . You will get three duplicated block ,and place them inside the on repeat times do block .change the P0 to P1 .
Step 7.Click Duplicated four times from the digital write pin to block over and pause (ms ) block over . You will get four duplicated block ,and place them inside the on forever block .change the P1 to P2 .
Step 8. Download this “.hex” file and send it to your MICROBIT disk.
Below is the full code we have done for you as reference:
DownLoad Url osoyoo.com