TZT 1LOT Infrared IR Wireless Remote Control Module Kits DIY Kit HX1838 For Arduino Raspberry Pi
Features:
#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 }}
ou will need one Arduino for this. I used a UNO, but just about any Arduino should work. First wire up the infrared receiver that came with your kit. There are 3 wires, PWR, GND, and SIG, I used port 11 for SIG. Note! some readers have reported that their sensor has different wiring, double check it yourself.
In order to reverse engineer the remote and obtain the codes for each button we are going to need to download and install the following library.http://github.com/shirriff/Arduino-IRremote Extract the file in your libraries directory. e.g. ( C:\electronics\arduino-1.0.5\libraries )note: I had to rename the library because the name was too long, I just renamed it to IR.
With the IR folder ( or whatever you named it) now in your libraries directory, we can import it into a new sketch.Start a new sketch and the Click Sketch->Import Library->IR.
Paste the following code into the new sketch. Then verify it compiles.#include <IRemote.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
}
}
Connect the Arduino to your computer using the usb port, then upload the sketch. Open up the Serial Monitor, get the remote and press the buttons. Some hex codes should appear on the Serial Monitor.Step 6: Record button codes
Brand Name : GREATZT
Dissipation Power : ..
Type : Voltage Regulator
Operating Temperature : -40-+85
Model Number : IR Wireless Remote Control Module Kits
is_customized : Yes
Supply Voltage : ..
Origin : Mainland China
Application : Computer
Condition : New
Package : DIY KIT
For Arduino STM : electronic module