-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDecode_IR.ino
46 lines (34 loc) · 1.11 KB
/
Decode_IR.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
* Sketch modified by Enjoying Electronics: http://www.instructables.com/member/Enjoying+Electronics/
Code based off of:
* IRremote
* Version 0.1 July, 2009
* Copyright 2009 Ken Shirriff
* For details, see http://arcfn.com/2009/08/multi-protocol-infrared-remote-library.html
* Special thanks to dablondeemu http://www.instructables.com/member/dablondeemu/
* and his instructable listed below, IR Remote Controlled Color Changing Cloud (Arduino)
* http://www.instructables.com/id/IR-Remote-Controlled-Color-Changing-Cloud-Arduino/
* Lets get started:
The IR sensor's pins are attached to Arduino as so:
Pin 1 to Vout (pin 11 on Arduino)
Pin 2 to GND
Pin 3 to Vcc (+5v from Arduino)
*/
/*******************CODE BEGINS HERE********************/
#include <IRremote.h>
int IRpin = 2;
IRrecv irrecv(IRpin);
decode_results results;
void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
}
void loop()
{
if (irrecv.decode(&results))
{
Serial.println(results.value, DEC); // Print the Serial 'results.value'
irrecv.resume(); // Receive the next value
}
}