Using AnalysIR's batch export with IRLib
Posted: Fri Dec 26, 2014 1:45 pm
A user from Singapore asked about including the automatically generated C code from AnalysIR for use with with IRLib.
The steps are simple:
- Download and install the latest version of IRLib library.
- First record the signals using AnalysIR
- Then use the batch export feature Menu->File->Batch Export->IRLib (IRremote, PSOC4 & LIRC also available.
- The C code is automatically placed in your clipboard for pasting.
- GO to your Arduino IDE and open the example IRsendDemo sketch provided with the IRLib library File->Examples->IRLib->IRsendDemo
- Edit the sketch and paste the code (CTRL+V) into the sketch to match the example provided below.
- Note we exported 3 RC6 signals and placed a 10 second gap between sending each signal. If the delau is too short it may confuse the system you are testing.
The steps are simple:
- Download and install the latest version of IRLib library.
- First record the signals using AnalysIR
- Then use the batch export feature Menu->File->Batch Export->IRLib (IRremote, PSOC4 & LIRC also available.
- The C code is automatically placed in your clipboard for pasting.
- GO to your Arduino IDE and open the example IRsendDemo sketch provided with the IRLib library File->Examples->IRLib->IRsendDemo
- Edit the sketch and paste the code (CTRL+V) into the sketch to match the example provided below.
- Note we exported 3 RC6 signals and placed a 10 second gap between sending each signal. If the delau is too short it may confuse the system you are testing.
Code: Select all
#include <IRLib.h>
IRsend My_Sender;
void setup()
{
Serial.begin(9600);
}
void loop() {
/*
Automatically Generated by AnalysIR - Batch Export Utility
Registered to: xxxxxxxx
Session History
Type : Key : Value : Bits
0 : RC6 : : 03202 : 20
1 : RC6 : : 00003202 : 20
2 : RC6 : : 00003202 : 20
*/
// NB: Not all protocols are supported by IRremote or IRLib. You may need to edit the code below manually
// Automatically Generated by AnalysIR for xxxxxxxx, visit http://www.AnalysIR.com or email info@....... for further details
int khz=38; //NB Change this default value as neccessary to the correct modulation frequency
My_Sender.send(RC6,0x03202, 20); //AnalysIR Batch Export (IRLib) // AnalysIR IR Protocol: RC6, Key:
delay(10000);
My_Sender.send(RC6,0x00003202, 20); //AnalysIR Batch Export (IRLib) // AnalysIR IR Protocol: RC6, Key:
delay(10000);
My_Sender.send(RC6,0x00003202, 20); //AnalysIR Batch Export (IRLib) // AnalysIR IR Protocol: RC6, Key:
delay(10000);
}