I have an application running on an Arduino Node MCU board which sends IR commands to an IR transmitter to control an EliteScreen media device. I simply send the raw hex value to the IR transmitter and it works as follows :
String command = "FDA2256";
irsend.sendElitescreens(stringToUint_64(command));
How does this function work exactly?
Now I am porting this functionality to an ESP32-C6-DevKitM-1 board.
The ESP-IDF library provides an IR transceiver example : examples\peripherals\rmt\ir_nec_transceiver
However, the function to send the IR message must have an address and command. It's not possible to send the raw hex command like in the Arduino application. This is what I must use :
const ir_nec_scan_code_t scan_code = {
.address = 0x0440, // Dummy value
.command = 0x3003, // Dummy value
};
ESP_ERROR_CHECK(rmt_transmit(tx_channel, nec_encoder, &scan_code, sizeof(scan_code), &transmit_config));
How could I send the raw hex command of 0xFDA2256 to the transmitter without using addresses etc.? I'm not sure how to progress here.
When the Arduino IR receiver application IRrecvDumpV3.ino gets this message from the above ESP-IDF TX application, the below is dumped. Where does the 0x220C00C come from, if I am only sending address = 0x0440 and command = 0x3003 ?
Timestamp : 000011.310
Library : v2.8.6
Protocol : NEC_LIKE
Code : 0x220C00C (32 Bits)
uint16_t rawData[67] = {9044, 4456, 600, 552, 552, 550, 580, 552, 576, 554, 552, 554, 576, 554, 552, 1684, 580, 550, 552, 550, 580, 552, 494, 1742, 578, 552, 570, 562, 552, 552, 578, 552, 552, 552, 580, 1682, 556, 1680, 578, 552, 554, 548, 580, 552, 540, 590, 552, 552, 580, 550, 554, 550, 578, 552, 552, 552, 580, 550, 494, 1742, 580, 1682, 534, 596, 554, 550, 578}; // NEC_LIKE 220C00C
uint32_t address = 0x440;
uint32_t command = 0x0;
uint64_t data = 0x220C00C;