Welcome to Building:bit Superkit repository
2.5 Infrared detection broadcast
Infrared detection broadcast
Infrared detection broadcast1. Learning objectives2. Sensor wiring3. Programming3.1 Add expansion package3.2 Building blocks used3.3 Combining blocks4. Experimental phenomenon
1. Learning objectives
In this course, we mainly learn how to display infrared detection broadcasts through MakeCode graphical programming.
2. Sensor wiring
The infrared module is connected to the P5P11 interface.

3. Programming
Method 1 Online programming:
First, connect micro:bit to the computer via a USB data cable. The computer will pop up a U disk. Click the URL in the U disk: https://makecode.microbit.org/ to enter the programming interface. Then, add the Yahboom software package https://github.com/YahboomTechnology/SuperBitLibV2 to start programming.
Method 2 Offline programming:
Open the offline programming software MakeCode and enter the programming interface. Click [New] and add the Yahboom software package https://github.com/YahboomTechnology/SuperBitLibV2 to start programming.
3.1 Add expansion package


3.2 Building blocks used
The location of the building blocks required for this programming is shown in the figure below.



3.3 Combining blocks
The summary program is shown in the figure below.

You can also directly open the Infrared-detection-broadcast.hex file provided in this experiment and drag it into the browser that opens the URL, and the program diagram of this project source code will be automatically opened
4. Experimental phenomenon
After the program runs successfully, when an obstacle is detected, the microbit dot matrix displays 1 and plays jump up music, otherwise it displays 0.