Arduino and process IR remote keys

The IR reciever and remote were part of a kit

Code

#include “IRremote.h”

int receiver = 3;
IRrecv irrecv(receiver);
decode_results results;

void setup()
{
Serial.begin(9600);
irrecv.enableIRIn();
}

void loop()
{
if (irrecv.decode(&results))
{
decodeIR();
irrecv.resume();
}
}

void decodeIR()
{
switch(results.value)
{
case 0xFF6897:
Serial.println(“0”);
break;
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(“dont know”);
}
delay(500);

}

Related posts

Arduino and GY-21P readings on a web page

MPL3115A2 sensor readings displayed on a web page

Adafruit Neopixel shield examples