SHOW:
|
|
- or go back to the newest paste.
1 | include <IRremote.h> | |
2 | ||
3 | int RECV_PIN = 11; | |
4 | ||
5 | IRrecv irrecv(RECV_PIN); | |
6 | ||
7 | decode_results results; | |
8 | ||
9 | void setup() | |
10 | { | |
11 | Serial.begin(9600); | |
12 | irrecv.enableIRIn(); // Start the receiver | |
13 | pinMode(12,OUTPUT);//Pin For Led | |
14 | } | |
15 | ||
16 | void loop() { | |
17 | if (irrecv.decode(&results)) { | |
18 | Serial.println(results.value,DEC); | |
19 | if(results.value==33427695)//<--Replace the new decimal value here | |
20 | { | |
21 | Serial.println("OK Pressed"); | |
22 | if(digitalRead(12)==LOW) | |
23 | {digitalWrite(12,HIGH); | |
24 | } | |
25 | else{ | |
26 | digitalWrite(12,LOW); | |
27 | } | |
28 | } | |
29 | irrecv.resume(); | |
30 | } | |
31 | } |