제품사양

전압: 3~5V

적외선신호를 수신할수 있는 모듈 입니다.

적외선 리모콘등으로 값을 받을수 있습니다

 

이미지

 

 

 

 

아두이노 소스코드

//홈페이지: www.daduino.co.kr

//이메일: daduino@daduino.co.kr

 

//모듈선연결: 흰색 S, 빨강 +, 검정 -

//아두이노 선연결: 흰색 S, 빨강 +, 검정 -

//아두이노의 2번핀에 연결

//시리얼모니터로 값을 확인

 

 

#include <IRremote.h>

 

int RECV_PIN = 2;

 

IRrecv irrecv(RECV_PIN);

IRsend irsend;

 

decode_results results;

 

void setup()

{

  Serial.begin(9600);

  // In case the interrupt driver crashes on setup, give a clue

  // to the user what's going on.

  Serial.println("Enabling IRin");

  irrecv.enableIRIn(); // Start the receiver

  Serial.println("Enabled IRin");

}

 

void loop() {

  irsend.sendNEC(0x34895725, 32);

 

  if (irrecv.decode(&results)) {

    Serial.println(results.value, HEX);

    irrecv.resume(); // Receive the next value

  }

  delay(100);

}

 

전체 소스코드 라이브러리 다운로드 클릭