목차
[WAT-S035] IR 수신 모듈
본 제품은 [WAT-SK114]중요한 아두이노 센서키트(초급) 중 35번째 모듈로 IR 수신 모듈입니다.
핀 번호
번호 | 핀명 | I/O | 기능 |
---|---|---|---|
1 | G | GND | GROUND |
2 | R | VCC | VCC |
3 | Y | RX Signal | 수신 신호 |
WAT-Arduino128 예제
핀 연결
번호 | I/O | WAT-Arduino128 |
---|---|---|
1 | G | GROUND |
2 | R | 5V |
3 | Y | PB7 |
소스코드
최신 소스코드는 [파일]=>[예제]=> [WhiteAT]=>[Sensor37] => [35_IR_RX] 에 에 있으며
라이브러리는 아두이노 개발환경 을 참조하세요
/* 중요한 아두이노 센서키트 37종 예제 중 35 번째 WAT-Arduino128 과 IR 수신 예제입니다. WAT-Arduino128 : https://kit128.com/goods/view?no=64 37종 센서: https://kit128.com/goods/view?no=114 출처: http://whiteat.com/Arduino */ #include <W_IRremote.h> int RECV_PIN = PB7; W_IRrecv irrecv(RECV_PIN); decode_results results; // 프로그램 시작 - 초기화 작업 void setup() { Serial.begin(115200); // 시리얼 통신 초기화 Serial.println("Arduino Examples - IR Receive Module"); Serial.println(" https://docs.whiteat.com/?p=1296"); irrecv.enableIRIn(); // Start the receiver } void loop() { if (irrecv.decode(&results)) { Serial.println(results.value, HEX); irrecv.resume(); // Receive the next value } delay(100); }
결과 화면
앞의 IR 송신모듈에서 보내는 데이터를 수신하였습니다.
(IR 송신 측에서 10 부터 1씩 증가한 값을 보내고 있습니다.)
Arduino UNO R3 예제
핀 연결
번호 | I/O | UNO R3 |
---|---|---|
1 | G | GND |
2 | R | 5V |
3 | Y | 11 |
소스코드
최신 소스코드는 [파일]=>[예제]=> [WhiteAT UNO]=>[Sensor37] => [35_IR_RX] 에 에 있으며
라이브러리는 아두이노 개발환경 을 참조하세요
/* 중요한 아두이노 센서키트 37종 예제 중 35 번째 UNO 와 IR 수신 예제입니다. UNO R3 : https://kit128.com/goods/view?no=337 37종 센서: https://kit128.com/goods/view?no=114 출처: http://whiteat.com/Arduino */ #include <W_IRremote.h> int RECV_PIN = 11; // 11 for UNO W_IRrecv irrecv(RECV_PIN); decode_results results; // 프로그램 시작 - 초기화 작업 void setup() { Serial.begin(115200); // 시리얼 통신 초기화 Serial.println("Arduino Examples - IR Receive Module"); Serial.println(" https://docs.whiteat.com/?p=1296"); irrecv.enableIRIn(); // Start the receiver } void loop() { if (irrecv.decode(&results)) { Serial.println(results.value, HEX); irrecv.resume(); // Receive the next value } delay(100); }
결과 화면
앞의 IR 송신모듈에서 보내는 데이터를 수신하였습니다.
(IR 송신 측에서 10 부터 1씩 증가한 값을 보내고 있습니다.)
제품 구매
[WAT-SK114]중요한 아두이노 센서키트(초급)은 https://kit128.com/goods/view?no=114 에서
[WAT-S035] IR 수신 모듈은 https://kit128.com/goods/view?no=435 에서 구매하실 수 있습니다.