In this application, we will flash three LEDs with an IR control. We will use the Infrared Sensor VS1838 receiver module as the IR receiver.
Youtube Channel:
First of all, we need to add the “IRremote.h” library in the Arduino IDE code screen. As seen in the codes below, we do this with the "#include <IRremote.h>" line.
We connect the signal pin of the sensor module to pin 2 of our UNO card.
Each of the keys on the IR remote has a 16-digit equivalent. In the codes below, the equivalents of the keys 1, 2 and 3 in the 16-number system are seen.
As the keys are pressed, we detect which key was pressed with the help of the “if” command and turn on the relevant led. Again, we use the "digitalWrite" command to light the LEDs.