프로그래밍/아두이노
아두이노 적외선 리모콘
-현's-
2016. 1. 1. 22:09
반응형
●아두이노 적외선 리모콘
- 아래 사이트에서 라이브러리를 다운받아 내 컴퓨터의 아두이노 설치경로인 Arduino\libraries에 복사한다. 적외선 리모콘 기능을 쓰려면 #include <IRremote.h>를 추가해야한다.
https://github.com/shirriff/Arduino-IRremote/
●적외선 리모콘 예제
#include <IRremote.h> int RECV_PIN=2; IRrecv irrecv(RECV_PIN); decode_results results; void setup() { Serial.begin(9600); irrecv.enableIRIn(); } void loop() { if(irrecv.decode(&results)){ Serial.println(results.value, HEX); irrecv.resume(); } delay(100); } |
반응형