HOW to Use IR Remotely Control RGB with Microbit
Overview
In the previous experiment, we used an infrared receiver module and a micro: bit control board to decode the infrared remote control. After decoding, we got the corresponding values of each key on infrared remote control. Thus, we can control other external sensors / modules based on these data. In this experiment, we add an SMD RGB module and control LED of RGB module to display the corresponding color by infrared remote.
Components Needed
-
Micro: bit motherboard * 1
-
Keyestudio Micro bit sensor V2 expansion board * 1
-
USB cable * 1
-
Keyestudio Digital IR Receiver Module * 1
-
keyestudio RGB LED Module * 1
-
Keyestudio infrared remote control * 1
-
DuPont jumper wire*7
-
Premium Battery Holder 6-cell AA*1
-
1.5V AA Battery*6
Connection Diagram
Test Code
Need to add library file, please refer to the previous lesson.
Notes:
Some infrared remote controls don’t come with a battery and need to be configured by yourself. The battery model is CR2025.
Before testing, make sure that the infrared remote control is OK. There is a tip for you: open the camera of the mobile phone to point at the signal light of infrared remote control, then press the button of remote control. If you see a purple light flashing via the cellphone, which means that the IR remote control is OK.
Test Results
Wire according to connection diagram, plug in external power and upload code to micro:bit, Point IR remote control at IR receiving head of expansion board, press the button. Pressbutton, LED of RGB displays red color;press
button,LED is green color;tap
button,LED shows blue color;press
button, LED is purple color;when the other buttons are pressed, LED is white.