Ks0026 keyestudio Digital IR Receiver Module: Difference between revisions
Keyestudio (talk | contribs) |
Keyestudio (talk | contribs) |
||
Line 21: | Line 21: | ||
<pre> | <pre> | ||
#include <IRremote.h> | #include <IRremote.h> | ||
int RECV_PIN = 11; | |||
IRrecv irrecv(RECV_PIN); | |||
decode_results results; | |||
void setup() | |||
{ | { | ||
Serial.begin(9600); | |||
irrecv.enableIRIn(); // Start the receiver | |||
} | } | ||
void loop() { | |||
if (irrecv.decode(&results)) { | |||
Serial.println(results.value, HEX); | |||
irrecv.resume(); // Receive the next value | |||
}</pre> | } | ||
} | |||
</pre> | |||
== Test == | == Test == |
Revision as of 16:45, 11 June 2018
Introduction
IR is widely used in remote control. With this IR receiver, Arduino project is able to receive command from any IR remoter controllers if you have the right decoder. Well, it will be also easy to make your own IR controller using IR transmitter.
Specification
- Power Supply: 5V
- Interface: Digital
- Modulation Frequency: 38Khz
- Module Interface Socket: JST PH2.0
- Size: 30*20mm
- Weight: 4g
Connection Diagram
The following image shows a suggested connection method. You may use any Digital I/O pin that is not in use by another device.
NOTE: In the sample code below Digital pin 11 is in use, you may either change your wiring or change the sample code to match.
Sample Code
#include <IRremote.h> int RECV_PIN = 11; IRrecv irrecv(RECV_PIN); decode_results results; void setup() { Serial.begin(9600); irrecv.enableIRIn(); // Start the receiver } void loop() { if (irrecv.decode(&results)) { Serial.println(results.value, HEX); irrecv.resume(); // Receive the next value } }
Test
Resources
Library
IR Remote Library includes some sample codes for sending and receiving: IR Remote Library
https://drive.google.com/open?id=1-jbx7joIypBtdw9GL3NvKs64W-eBbnZw
Video
http://www.keyestudio.com/wp/ks0026-ks0027/
Buy from
Official Website
http://www.keyestudio.com/keyestudio-digital-ir-receiver-module-for-arduino.html