#include "IRremote.h"
int receiver = 11;
IRrecv irrecv(receiver);
decode_results results;
void setup()
{
Serial.begin(9600);
irrecv.enableIRIn();
}
void loop()
{
if (irrecv.decode(&results))
{
Serial.println(results.value, HEX);
translateIR();
irrecv.resume();
}
}
void translateIR()
{
switch(results.value)
{
case 0xFF30CF:
Serial.println(" 1 ");
break;
case 0xFF18E7:
Serial.println(" 2 ");
break;
case 0xFF7A85:
Serial.println(" 3");
break;
case 0xFF10EF:
Serial.println(" 4 ");
break;
case 0xFF38C7:
Serial.println(" 5 ");
break;
case 0xFF5AA5:
Serial.println(" 6 ");
break;
case 0xFF42BD:
Serial.println(" 7 ");
break;
case 0xFF4AB5:
Serial.println(" 8 ");
break;
case 0xFF52AD:
Serial.println(" 9 ");
break;
default:
Serial.println(" other ");
}
delay(500);
}
//NOTE:
//IR SENSOR AT PIN 11
int receiver = 11;
IRrecv irrecv(receiver);
decode_results results;
void setup()
{
Serial.begin(9600);
irrecv.enableIRIn();
}
void loop()
{
if (irrecv.decode(&results))
{
Serial.println(results.value, HEX);
translateIR();
irrecv.resume();
}
}
void translateIR()
{
switch(results.value)
{
case 0xFF30CF:
Serial.println(" 1 ");
break;
case 0xFF18E7:
Serial.println(" 2 ");
break;
case 0xFF7A85:
Serial.println(" 3");
break;
case 0xFF10EF:
Serial.println(" 4 ");
break;
case 0xFF38C7:
Serial.println(" 5 ");
break;
case 0xFF5AA5:
Serial.println(" 6 ");
break;
case 0xFF42BD:
Serial.println(" 7 ");
break;
case 0xFF4AB5:
Serial.println(" 8 ");
break;
case 0xFF52AD:
Serial.println(" 9 ");
break;
default:
Serial.println(" other ");
}
delay(500);
}
//NOTE:
//IR SENSOR AT PIN 11