Adding Custom IR Codes - xoseperez/espurna GitHub Wiki
- Open
code/espurna/ir.cpp
in your favourite text editor - Find the presets location, currently inside of the
::ir::terminal::build::preset()
function - Make a copy of any IR code set, to allow us to modify it. Update the
IR_RX_PRESET
index as well. - Use IRrecvDumpV2 or IRrecvDumpV3 to get IR Codes. You'd get something like this:
Timestamp : 002222.937
Encoding : NEC
Code : FFE01F (32 bits)
Library : v2.3.2
Raw Timing[71]:
10816, - 4494, + 674, - 572, + 674, - 572, + 672, - 572,
672, - 572, + 672, - 600, + 646, - 572, + 672, - 572,
672, - 572, + 676, - 1678, + 668, - 1680, + 666, - 1708,
644, - 1682, + 670, - 1682, + 672, - 1680, + 678, - 1682,
674, - 1682, + 676, - 1704, + 658, - 1680, + 682, - 1682,
686, - 574, + 684, - 574, + 682, - 574, + 744, - 518,
670, - 570, + 668, - 570, + 672, - 572, + 676, - 572,
676, - 1678, + 678, - 1680, + 676, - 1680, + 676, - 1680,
680, - 1682, + 746, - 40008, + 10806, - 2228, + 668
uint16_t rawData[71] = {10816, 4494, 674, 572, 674, 572, 672, 572, 672, 572, 672, 600, 646, 572, 672, 572, 672, 572, 676, 1678, 668, 1680, 666, 1708, 644, 1682, 670, 1682, 672, 1680, 678, 1682, 674, 1682, 676, 1704, 658, 1680, 682, 1682, 686, 574, 684, 574, 682, 574, 744, 518, 670, 570, 668, 570, 672, 572, 676, 572, 676, 1678, 678, 1680, 676, 1680, 676, 1680, 680, 1682, 746, >40008, 10806, 2228, 668}; // NEC FFE01F
uint32_t address = 0x0;
uint32_t command = 0x7;
uint64_t data = 0xFFE01F;
TODO: code example
The uint64_t data
value is useful to us.
- Update the code(s) from the received data
- Don't forget to change the
IR_RX_PRESET' value in the build flags or for the board of your choice in
code/espurna/hardware.h`