//**************
//IR receive demo v1.0
//Connect the IR sent pins to D2 for this demo
//******************************
#include <IRSendRev.h>
int ledPin = 3;
int buzzerPin = 4;
int IR_Receiver=2;
unsigned char dta[20];

void setup()
{
    pinMode(ledPin, OUTPUT);   
    pinMode(buzzerPin, OUTPUT);   
    IR.Init(IR_Receiver);
    Serial.begin(9600);
    Serial.println("init over");
}

void loop()
{
    if(IR.IsDta())
    {
          IR.Recv(dta);
          Serial.println(dta[6]);
          if(dta[6]==1)
          {
              digitalWrite(ledPin, HIGH);
          }
           if(dta[6]==2)
          {
              digitalWrite(buzzerPin, HIGH);
          }
           if(dta[6]==3)
          {
              digitalWrite(ledPin, LOW);
              digitalWrite(buzzerPin, LOW);
          }
     } 
}
