#include <IRremote.h>
int signal = 7;
//int led = 12;
//int led2 = 10;
//int led3 = 6;
//int led4 = 3;
//int analog = A0;
void setup() {
Serial.begin(9600);
IrReceiver.begin(7);
//pinMode(12, OUTPUT);
//pinMode(10, OUTPUT);
//pinMode(6, OUTPUT);
//pinMode(3, OUTPUT);
//pinMode(A0, OUTPUT);
// put your setup code here, to run once:
}
void loop() {
if (IrReceiver.decode())
{
Serial.println(IrReceiver.decodedIRData.command);
IrReceiver.resume();
int remote = IrReceiver.decodedIRData.command;
switch (remote)
{
case 162:
Serial.println("You pressed Button POWER");
//digitalWrite(led, HIGH);
//digitalWrite(analog, LOW);
//digitalWrite(led2, LOW);
//digitalWrite(led3, LOW);
//digitalWrite(led4, LOW);
delay(1000);
break;
case 48:
Serial.println("You pressed Button 1");
//digitalWrite(led, LOW);
//digitalWrite(led2, HIGH);
//digitalWrite(led3, LOW);
//digitalWrite(led4, LOW);
//digitalWrite(analog, LOW);
delay(1000);
break;
case 24:
Serial.println("You pressed Button 2");
//digitalWrite(led, LOW);
//digitalWrite(led2, LOW);
//digitalWrite(led3, HIGH);
//digitalWrite(led4, LOW);
//digitalWrite(analog, LOW);
delay(1000);
break;
case 122:
Serial.println("You pressed Button 3");
//digitalWrite(led, LOW);
//digitalWrite(led2, LOW);
//digitalWrite(led3, LOW);
//digitalWrite(led4, HIGH);
//digitalWrite(analog, HIGH);
delay(1000);
break;
case 16:
Serial.println("You pressed Button 4");
//digitalWrite(led, HIGH);
//delay(2000);
//digitalWrite(led2, HIGH);
//delay(2000);
//digitalWrite(led3, HIGH);
//delay(2000);
//digitalWrite(led4, HIGH);
//digitalWrite(analog, LOW);
delay(1000);
break;
case 90:
Serial.println("You pressed Button 5");
//digitalWrite(led, LOW);
delay(1000);
break;
case 56:
Serial.println("You pressed Button 6");
//digitalWrite(led, LOW);
delay(1000);
break;
case 66:
Serial.println("You pressed Button 7");
//digitalWrite(led, LOW);
delay(1000);
break;
case 74:
Serial.println("You pressed Button 8");
//digitalWrite(led, LOW);
delay(1000);
break;
case 82:
Serial.println("You pressed Button 9");
//digitalWrite(led, LOW);
delay(1000);
break;
case 226:
Serial.println("You pressed Button MENU");
//digitalWrite(led, LOW);
delay(1000);
break;
case 34:
Serial.println("You pressed Button TEST");
//digitalWrite(led, LOW);
delay(1000);
break;
case 2:
Serial.println("You pressed Button +");
//digitalWrite(led, LOW);
delay(1000);
break;
case 194:
Serial.println("You pressed Button BACK BUTTON");
//digitalWrite(led, LOW);
delay(1000);
break;
case 224:
Serial.println("You pressed Button PREVIOUS");
//digitalWrite(led, LOW);
delay(1000);
break;
case 168:
Serial.println("You pressed Button PLAY/PAUSE");
//digitalWrite(led, LOW);
delay(1000);
break;
case 144:
Serial.println("You pressed Button NEXT");
//digitalWrite(led, LOW);
delay(1000);
break;
case 104:
Serial.println("You pressed Button 0");
//digitalWrite(led, LOW);
delay(1000);
break;
case 152:
Serial.println("You pressed Button - Button");
//digitalWrite(led, LOW);
delay(1000);
break;
case 176:
Serial.println("You pressed Button c button");
//digitalWrite(led, LOW);
delay(1000);
break;
}
}
// put your main code here, to run repeatedly:
}