Hardware components | ||||||
| × | 1 | ||||
| × | 1 | ||||
| × | 3 | ||||
| × | 1 | ||||
| × | 1 | ||||
| × | 1 | ||||
| × | 1 | ||||
| × | 1 | ||||
Software apps and online services | ||||||
|
button 1: Red led
button 2: Green led
button 3: Blue led
button 4: Buzzer
Key Code
CH- 0xFFA25D
CH 0xFF629D
CH+ 0xFFE21D
<< 0xFF22DD
>> 0xFF02FD
>|| 0xFFC23D
– 0xFFE01F
+ 0xFFA857
EQ 0xFF906F
100+ 0xFF9867
200+ 0xFFB04F
0 0XFF6897
1 0xFF30CF
2 0xFF18E7
3 0xFF7A85
4 0xFF10EF
5 0xFF38C7
6 0xFF5AA5
7 0xFF42BD
8 0xFF4AB5
9 0xFF52AD
#include <IRremote.h>
const int RECV_PIN = 7;
IRrecv irrecv(RECV_PIN);
decode_results results;
const int redPin = 10;
const int greenPin = 11;
const int bluePin = 9;
const int buzzPin = 8;
void setup(){
irrecv.enableIRIn();
irrecv.blink13(true);
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
pinMode(buzzPin, OUTPUT);
}
void loop(){
if (irrecv.decode(&results)){
switch(results.value){
case 0xFF30CF: //Keypad button "5"
digitalWrite(redPin, HIGH);
delay(2000);
digitalWrite(redPin, LOW);
}
switch(results.value){
case 0xFF18E7: //Keypad button "2"
digitalWrite(greenPin, HIGH);
delay(2000);
digitalWrite(greenPin, LOW);
}
switch(results.value){
case 0xFF7A85: //Keypad button "2"
digitalWrite(bluePin, HIGH);
delay(2000);
digitalWrite(bluePin, LOW);
}
switch(results.value){
case 0xFF10EF: //Keypad button "2"
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
delay(100);
digitalWrite(buzzPin, HIGH);
delay(100);
digitalWrite(buzzPin, LOW);
}
irrecv.resume();
}
}
Comments