Note: ALL OSOYOO Products for Arduino are Third Party Board which is fully compatible with Arduino

LACC2006AD-22LACC2006AD-37

In this project, we will use IR receiver VS1838B to decode the signal sent by any Infrared Remote controller(i.e.remote controllers for TV, DVD, Satellite box, and the IR controller with this kit etc).

Step 1 – Connect board with IR Receiver
Connect Signal-Out pin(left),Ground pin(middle) and VCC pin(right),connect Signal out pin to D10,Grand to GND and VCC to 5V as per following graph:

vs1838Ba


Step 2Download IRremote Library, and then import the library into Arduino IDE(in Arduino IDE->Sketch->Import Library->Add Library)

NOTE!!

  1. If you have a late version of Arduino IDE with a library IRRobotRemote, it may conflict and you may have to remove that library.Make sure to delete Arduino(root)/libraries/RobotIRremote. Where Arduino(root) refers to the install directory of Arduino. The library RobotIRremote has similar definitions to IRremote and causes errors.
  2. Learn how to install an Arduino library on Arduino IDE, please visit https://osoyoo.com/2017/05/08/how-to-install-additional-arduino-libraries/

Step 3Download irdemo.ino sketch file, load it into Arduin.

#include "IRremote.hpp"
#define IR_RECEIVE_PIN 10

void setup() {
  Serial.begin(9600);
  IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);  
}

void loop() {
  if (IrReceiver.decode()) {
    IrReceiver.printIRResultShort(&Serial);
    IrReceiver.resume();
  }
}

Step 4 – Point the Remote controller to the flat side of IR receiver(the side with “VS1838B” printing), then push any key on the remote controller. click the serial monitor in the upright corner of IDE window. The monitor Window will show the code of the key you just pushed. see following graph:

 

公式ストアは下記のリンクをクリック

Amazonですぐ購入!