Infrared Receiver, Remote Control: 두 판 사이의 차이

아두위키 : Arduwiki
(Created page with " {{#seo:|title=아두위키 : 아두이노 적외선 수신기, 리모컨 가이드|title_mode=append|keywords=아두이노, 정보과학, 메이커학습, 수행평가, 적외선 수신기, 리모컨, 아두이노 작품, 캡스톤작품, 아두이노 예제코드|description=아두이노로 적외선 수신기, 리모컨을 제어하는 방법(기본정보, 회로, 예제 코드)을 소개합니다. 정보과학과 메이커수업에 활용가능합니다.}} 파일...")
 
잔글편집 요약 없음
 
3번째 줄: 3번째 줄:


{{#seo:|title=아두위키 : 아두이노 적외선 수신기, 리모컨 가이드|title_mode=append|keywords=아두이노, 정보과학, 메이커학습, 수행평가, 적외선 수신기, 리모컨, 아두이노 작품, 캡스톤작품, 아두이노 예제코드|description=아두이노로 적외선 수신기, 리모컨을 제어하는 방법(기본정보, 회로, 예제 코드)을 소개합니다. 정보과학과 메이커수업에 활용가능합니다.}}
{{#seo:|title=아두위키 : 아두이노 적외선 수신기, 리모컨 가이드|title_mode=append|keywords=아두이노, 정보과학, 메이커학습, 수행평가, 적외선 수신기, 리모컨, 아두이노 작품, 캡스톤작품, 아두이노 예제코드|description=아두이노로 적외선 수신기, 리모컨을 제어하는 방법(기본정보, 회로, 예제 코드)을 소개합니다. 정보과학과 메이커수업에 활용가능합니다.}}
[[파일:적외선리모컨수신기.jpg|center|class=coders100]]
[[File:적외선리모컨수신기.jpg|center|class=coders100]]


=== Infrared Receiver ===
=== Infrared Receiver ===
67번째 줄: 67번째 줄:
| colspan="1" rowspan="1" |connection
| colspan="1" rowspan="1" |connection
|}
|}
[[파일:적외선_리모컨_수신기회로.png|center|class=coders100]]
[[File:적외선 리모컨 수신기회로.png|center|class=coders100]]


== '''Libraries (Install via Library Manager)''' ==
== '''Libraries (Install via Library Manager)''' ==
126번째 줄: 126번째 줄:


=== Execution Result ===
=== Execution Result ===
[[파일:적외선_실행결과.jpg|center|class=coders100]]
[[File:적외선 실행결과.jpg|center|class=coders100]]

2024년 3월 24일 (일) 12:41 기준 최신판


Infrared Receiver

  • A sensor that receives and outputs infrared signals in the 38KHz band.
  • It is capable of reception only.

IR Remote Control

  • A remote control device that transmits signals receivable by the infrared receiver.

Specifications

Infrared Receiver

  • Operating Voltage: 2.7V ~ 5.5V
  • Reception Angle: Approximately 90 degrees
  • Infrared Frequency: 38KHz

Remote Control

  • Operating Voltage: 5V
  • Frequency: 38KHz

Hardware

  • Arduino Uno
  • Infrared Receiver, Remote Control
  • LED 5mm
  • 220-ohm Resistor
  • Jumper cables

Connection

Arduino Uno Infrared Receiver LED Resistor
5V VCC
GND GND -
A0 connection
D8 +
OUT connection

Libraries (Install via Library Manager)

  • IRremote by shirriff
  • z3t0
  • ArminJo

Arduino Libraries

Example Code

Checking Infrared Reception Values per Button Press

Displays the value corresponding to the pressed button on the remote control to the serial monitor.

#include <IRremote.h>

#define irOut A0

IRrecv irrecv(irOut);

void setup() {
  Serial.begin(9600);
  Serial.println("Serial start");
  irrecv.enableIRIn();
}

void loop() {
  if (irrecv.decode()) {
    Serial.println(irrecv.decodedIRData.decodedRawData);
    irrecv.resume();
  }
}

Main Code

Turns on the LED when a button on the remote control is pressed.

#include <IRremote.h>

#define irOut A0

IRrecv irrecv(irOut);

void setup() {
  Serial.begin(9600);
  Serial.println("Serial start");
  irrecv.enableIRIn();
}

void loop() {
  if (irrecv.decode()) {
    Serial.println(irrecv.decodedIRData.decodedRawData);
    irrecv.resume();
  }
}

Execution Result