Connect green LED lamp with OSOYOO PnP board for micro:bit P0 with OSOYOO 3-pin PnP cable ;

Connect yellow LED lamp with OSOYOO PnP board for micro:bit P1 with OSOYOO 3-pin PnP cable ;

Connect red LED lamp with OSOYOO PnP board for micro:bit P2 with OSOYOO 3-pin PnP cable as below;


Step 0: Go to url: https://makecode.microbit.org , click New Project , right click on start block and delete it.

Step 1: In the Toolbox, click on the Pins category and then click the digital write pin block , and then Drag and drop the block inside the forever block. set digital write pin P0 value to  1 as following figure:


Step 2. Click on the Basic category. Then drag the Pause (ms) block  and drop it inside the forever block just below  the digital write pin   block ,and set pause time  5000 ms  from the drop-down menu as following figure.

Step 3. 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 just below the pause(ms)   block. Set repeat times to 4.

Step 4. Click on the Pins category again and then click the digital write pin block ,  then Drag and drop the block inside the  repeat times do block. set digital write pin P0 value to  1 as following figure:

Step 5.Click on the Basic category. Then  drag the pause (ms) block  and drop it inside the repeat times do block just below  the digital write pin   block ,and set pause time  500 ms  from the drop-down menu as following figure.

Step 6.Repeat duplicate method to make another  digital write pin blocks and another  pause(ms) blocks .   set P0 value to 0 exactly same as following figure.
Step 7.Click Duplicated  the repeat 4 times do block .  Now we should have a same block like the repeat 4 times do block .put  it inside the forever block under the repeat 4 times do block, then  put the repeat times to 3,set write pin P0 to P1 as following figure: 

Step 8.Click on the Pins category again and then click the digital write pin block ,  then Drag and drop the block inside the  forever block. set digital write pin P0 to P2, set P2 value to 1 as following figure:

Step 9.Click on the Basic category again. Then  drag the Pause (ms) block  and drop it inside the forever block just below  the digital write pin block ,and set pause time  5000 ms  from the drop-down menu as following figure.

Step 10.Click Duplicated  the repeat 3 times do block .  Now we should have a same block like the repeat 3 times do block .put  it inside the forever block under the repeat 3 times do block, then  put the repeat times to 4,set write pin P1 to P2 as following figure: 

Step 11. Download this “.hex” file and save it to your MICROBIT disk Driver as following figure.

Below are the full Graphic programming code blocks  we have done for you as reference: