File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ /*
2
+ You can use this sketch to get codes from your IR remote control.
3
+ Code are send to Serial Port. IR receiver is connect to pin D7
4
+ External library IRremote is required (https://github.com/z3t0/Arduino-IRremote)
5
+ */
6
+
7
+ #include < IRremote.h>
8
+
9
+ // IR REMOTE CONTROL
10
+ int receirerPin = 7 ; // Arduino pin connected to IR receiver
11
+ IRrecv irReceiver (receirerPin);
12
+ decode_results irResults;
13
+
14
+ void setup ()
15
+ {
16
+ Serial.begin (9600 ); // start serial communication
17
+ irReceiver.enableIRIn (); // start the IR receiver
18
+ }
19
+
20
+ void loop () {
21
+ if (irReceiver.decode (&irResults)) {
22
+ Serial.println (irResults.value , HEX); // send data to PC
23
+ irReceiver.resume (); // Receive next value
24
+ }
25
+ delay (100 ); // some small delay
26
+ }
You can’t perform that action at this time.
0 commit comments