int RECV_PIN = 7;
byte led2Pin = 2;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
Serial.begin(9600);
Serial.println("Enabling IRin");
irrecv.enableIRIn(); // Start the receiver
Serial.println("Enabled IRin");
pinMode(led2Pin,OUTPUT);
digitalWrite(led2Pin,LOW);
}
void loop()
{
if (irrecv.decode(&results))
{
if(results.value==0XFF30CF)
{
digitalWrite(led2Pin,!digitalRead(led2Pin));
}
Serial.println(results.value,HEX);
irrecv.resume(); // Receive the next value
}
delay(100);
}
touch不良,開發板最好用公的 ,因為母的用久會鬆掉
沒有留言:
張貼留言