Untitled

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

#include <IRremote.

h>

int RECV_PIN = 10;


int S ;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
{
Serial.begin(9600);

Serial.println("Enabling IRin");
irrecv.enableIRIn();
Serial.println("Enabled IRin");

pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
pinMode(6,OUTPUT);

void loop()
{
if (irrecv.decode(&results))

{
S = results.value, HEX ;

Serial.println(S);
irrecv.resume(); // Receive the next value

if(S == 2295 )
{
digitalWrite(4,HIGH);
}

if(S == -30601 )
{
digitalWrite(4,LOW);
}

if(S == 18615 )
{
digitalWrite(5,HIGH);
}

if(S == 10455 )
{
digitalWrite(5,LOW);
}

if(S == -22441 )
{
digitalWrite(6,HIGH);
}

if(S == 26775 )
{
digitalWrite(6,LOW);
}

}
delay(10);
}

You might also like