http://blog.udn.com/andy840119/15096120
https://github.com/coopermaa/Arduino-IRremote
#include <IRremote.h>
long i;
int RECV_PIN = 6;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
Serial.begin(9600);
pinMode(9, OUTPUT);
irrecv.enableIRIn(); // Start the receiver
}
void loop() {
if (irrecv.decode(&results)) {
i = results.value;
Serial.println(i, HEX);
Serial.println(i, DEC);
Serial.println(i);
irrecv.resume(); // Receive the next value
}
if(i==16753245 or i==-484956645){digitalWrite(9,HIGH);}
if(i==5316027 or i==16736925){digitalWrite(9,LOW);}
}
沒有留言:
張貼留言