Connect IR receiver module to OSOYOO PnP board P8 port with OSOYOO 3-pin PnP cable as below;

If your micro :bit is version V1.X, use this tutorial link:https://osoyoo.com/?p=25202

Step 0: Go to urlhttps://makecode.microbit.org, click New Project  

Step 1. In the Editor controls, click on the Advanced button and then Extensions  as following figure.

Step 2. In the Extensions page , enter project URL “https://github.com/osoyoo/OSOYOO_IR_V2.0” in the Search textbox and click on the Search button. The page will show you all the matching extensions based on your search string. Now, click on OSYOO IR V2.0 to add it into your project .

Step 3. Click on the OSOYOO IR V2 category under Advanced. Drag on IR received message  block.

Step 4. In the Toolbox, click on the Variables category and then click the set message to button, Drag and drop a setmessage  to 0 block inside the on received message  block.

Step 5.Then In the New Variable name window, type “ir as the variable name, then click on the Ok button as following figure.

Step 6.Click on the Variables category again. Drag the message  block  and place it inside the placeholder of the set ir to block as following figure.

Step 7. In the Toolbox, click on the Logic category and drag the if-then-else block over .

Step 8. Click on the Logic category again, click and drag the 0=0 block over and place it inside  of the on IR received  block below the set ir to message block as following figure.

Step 9.Drag and drop a message  block from variable category and place it inside the placeholder of the 0=0 block as following figure .

Step 10.From OSOYOO_IR V2 category, drag and drop an IR KeyValue value  block  inside the placeholder of the 0=0 block, set NUM1 from drop-down menu.

Step 11.Click on the Variables category and then click the set ir to button, Drag and drop it inside the then  block,write 1 as following figure.

Step 12Click “+” to add an else section as following figure.

Step 13. Click on the Logic category again, click and drag the 0=0 block over and place it inside  of the else then block below the set ir to message block as following figure.

Step 14.Drag and drop a message  block from variable category and place it inside the placeholder of the 0=0 block as following figure .

Step 15.From OSOYOO_IR V2 category, drag and drop an IR KeyValue value  block  inside the placeholder of the 0=0 block, set CH_MINUS  from drop-down menu.

Step 16.Click on the Variables category again and then click the set ir to button, Drag and drop it inside the then  block,write as following figure.

Step 17Click “+” to add an else section as following figure.

Step 18. Click on the Logic category , click and drag the 0=0 block over and place it inside  of the else then block below the set ir to message block as following figure.

Step 19.Click OSOYOO_IR V2 category, drag and drop an IR KeyValue value  block  inside the placeholder of the 0=0 block, set CH  from drop-down menu.

Step 20.Click on the Variables category  and then click the set ir to button, Drag and drop it inside the then  block,write 3 as following figure.

Step 21.In the Toolbox, click on the Basic category and Click and drag the forever block as following figure.

Step 22.Click on the Logic category and drag the if-then-else block over inside the forever block .

Step 23. Click on the Logic category , click and drag the 0=0 block over and place it inside  of the if then block as following figure.

Step 24.Drag and drop a ir  block from variable category and place it inside the placeholder of the 0=0 block .write  as following figure .

Step 25. Then click the set ir to button, Drag and drop it inside the then  block as following figure.

Step 26.Click on the Basic category and Click and drag the show number  block .and write 5 as following figure

Step 27. Click and drag the pause(ms)   block .and choose 200ms from drop-down menu as following figure.

Step 28. Right-click duplicated from the show number block and pause (ms). Duplicate the last 4 blocks one by one, and then drag and drop under the forever block , and change show number as following.

Step 29.Click on the Basic category and Click and drag the show icon  block .and choose Smiley icon from drop-down menu as following figure.

Step 30Click “+” to add an else section as following figure.

Step 31. Click on the Logic category , click and drag the 0=0 block over and place it inside  of the else then block as following figure.

Step 32.Drag and drop a ir  block from variable category and place it inside the placeholder of the 0=0 block .write  as following figure .

Step 33. Then click the set ir to button, Drag and drop it inside the then  block as following figure.

Step 34.Click on the Basic category and Click and drag the show leds  block .and choose write “I” from drop-down menu as following figure.

Step 35. Click and drag the pause(ms)   block .and choose 200ms from drop-down menu as following figure.

Step 36.Right-click duplicated from theshow leds block and pause (ms).Duplicate the last 2 blocks one by one, and then drag and drop under forever block, and choose write Love icon and “U” as following:

Step 37Click “+” to add an else section as following figure.

Step 38. Click on the Logic category , click and drag the 0=0 block over and place it inside  of the else then block as following figure.

Step 39.Drag and drop a ir  block from variable category and place it inside the placeholder of the 0=0 block .write  as following figure .

Step 40. Then click the set ir to button, Drag and drop it inside the then  block as following figure.

Step 41.Click on the Basic category and Click and drag the show leds  block .and choose write a dot from drop-down menu as following figure.

Step 42. Click and drag the pause(ms)   block .and choose 200ms from drop-down menu as following figure.

Step 43.Right-click duplicated from the show leds block and pause (ms).Duplicate the last 4 blocks one by one, and then drag and drop under forever block, and choose write Love icon as following:

Step 44. 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,The quickest way to try out your part is to DOWNLOAD THIS HEX FILE and then copy it onto your micro:bit.


Learn More about parts

No. Picture Product Name Link
1 BBC micro:bit micro Mainboard https://osoyoo.store/products/bbc-micro-bit-micro-controller-with-motion-detection-compass-led-display-and-bluetooth?variant=31021023002735
2 OSOYOO Expansion board for Micro:bit https://osoyoo.store/products/pnp-board-for-micro-bit-stem-kitmodel-2018005900?variant=31698997444719
3 Green LED Module https://osoyoo.store/products/green-led-module-for-osoyoo-stem-kit-for-micro-bit-model-2019011500?variant=31957968158831
4 Yellow LED Module https://osoyoo.store/products/yellow-led-module-for-osoyoo-stem-kit-for-micro-bit-model-2019011500
5 Red LED Module https://osoyoo.store/products/red-led-module-for-osoyoo-stem-kit-for-micro-bit-model-2019011500?variant=31957964882031
6 White LED Module https://osoyoo.store/products/white-led-module-for-osoyoo-stem-kit-for-micro-bit-model-2019011500?variant=31816681128047
7 Humi & Temp Module https://osoyoo.store/products/humi-temp-module-for-osoyoo-stem-kit-for-micro-bit-model-2019011500?variant=31957977563247
8 Passive buzzer Module https://osoyoo.store/products/passive-buzzer-module-for-osoyoo-stem-kit-for-micro-bit-model-2019011500
9 Flame sensor Module https://osoyoo.store/products/flame-sensor-module-for-osoyoo-stem-kit-for-micro-bit-model-2019011500
10 Red Button Module https://osoyoo.store/products/red-button-module-for-osoyoo-stem-kit-for-micro-bit-model-2019011500?variant=31958006693999
11 Yellow Button Module https://osoyoo.store/products/yellow-button-module-for-osoyoo-stem-kit-for-micro-bit-model-2019011500?variant=31958014328943
12 Photoresitor Module https://osoyoo.store/products/photoresitor-module-for-arduino-microbit-osoyoo-stem-kitmodel-2019011500?variant=31958061154415
13 RGB Module https://osoyoo.store/products/rgb-module-for-osoyoo-stem-kit-for-micro-bit-arduino-raspberry-pi-model-2019011500?variant=31958069739631
14 IR Receiver Module https://osoyoo.store/products/ir-receiver-module-for-arduino-raspberry-pi-micro-bit-stem-model-2019011500?variant=31958077309039
15 Infrared Remote Controller https://osoyoo.store/products/infrared-remote-controller-for-arduino-raspberry-pi-microbit-stemmodel-2019011500?variant=31958087532655
16 Microphone Module https://osoyoo.store/products/microphone-module-for-arduino-raspberry-pi-micro-bit-stem-model-2019011500?variant=31958089597039
17 Potentiometer Module https://osoyoo.store/products/potentiometer-module-for-osoyoo-stem-kit-for-micro-bit-model-2019011500?variant=31817102852207
18 Fan Motor module https://osoyoo.store/products/fan-motor-module-for-osoyoo-stem-kit-for-micro-bit-model-2019011500?variant=31957989359727
19 Micro Servo motor https://osoyoo.store/products/micro-servo-sg90-blue-for-arduino-v2-0-robot-carmodel-lacc200610
20 Ultrasonic detector module https://osoyoo.store/products/ultrasonic-detector-module-for-arduino-raspberry-pi-micro-bit-stemmodel-2019011500?variant=31958286729327
21 1602 I2C LED Screen https://osoyoo.store/products/white-led-module-for-osoyoo-stem-kit-for-micro-bit-model-2019011501?variant=31817047048303
22 1 Channel Relay Module https://osoyoo.store/products/1-channel-relay-module-for-osoyoo-stem-kit-for-micro-bit-model-2019011500?variant=31957950562415