Help using the RMT Infrared transceiver
Posted: Fri May 31, 2024 12:36 pm
I have an application already working which runs on an Arduino Node MCU board which sends IR commands to an IR transmitter. There is good library support ( IRremoteESP8266 ) for to achieve this on the Arduino.
https://github.com/crankyoldgit/IRremot ... creens.cpp
Basically there are just three IR Hex commands which I must be able to send :
0xFEA3387 (STOP)
0xFDA2256 (UP)
0xFBA1136 (DOWN)
Example:
Now I wish to develop a similar application for an ESP32-C6-DevKitM-1 development board.
I am trying to understand and adapt the IR_NEC_TRANSCEIVER example which is part of the ESP-IDF repository :
https://github.com/espressif/esp-idf/tr ... ransceiver
There is a function called as follows in the example, with just random address and command values:
I am struggling to figure out how to simply send a hex command like from the Arduino application such as 0xFDA2256.
I tried the following:
There is an IRrecvDump application which runs on an Arduino which reads Infrared messages and dumps all the information. https://github.com/crankyoldgit/IRremot ... cvDump.ino
I don't understand how I end up with the data, code and address as below. My aim here is to have the data and code as 0xFDA2256 . I would appreciate any help or clarity with this. Thanks.
https://github.com/crankyoldgit/IRremot ... creens.cpp
Basically there are just three IR Hex commands which I must be able to send :
0xFEA3387 (STOP)
0xFDA2256 (UP)
0xFBA1136 (DOWN)
Example:
Code: Select all
irsend.sendElitescreens(0xFEA3387);
I am trying to understand and adapt the IR_NEC_TRANSCEIVER example which is part of the ESP-IDF repository :
https://github.com/espressif/esp-idf/tr ... ransceiver
There is a function called as follows in the example, with just random address and command values:
Code: Select all
const ir_nec_scan_code_t scan_code = {
.address = 0x0440,
.command = 0x3003,
};
rmt_transmit(tx_channel, nec_encoder, &scan_code, sizeof(scan_code), &transmit_config);
I tried the following:
Code: Select all
uint64_t payload = 0xFDA2256;
rmt_transmit(tx_channel, nec_encoder, &payload, sizeof(payload), &transmit_config);
I don't understand how I end up with the data, code and address as below. My aim here is to have the data and code as 0xFDA2256 . I would appreciate any help or clarity with this. Thanks.
Code: Select all
Timestamp : 000104.243
Library : v2.8.6
Protocol : NEC_LIKE
Code : 0x6A445BF0 (32 Bits)
uint16_t rawData[67] = {8992, 4508, 544, 562, 566, 1716, 522, 1716, 546, 560, 544, 1716, 546, 558, 542, 1720, 544, 560, 542, 588, 546, 1714, 540, 566, 544, 562, 568, 560, 544, 1716, 546, 558, 544, 586, 546, 558, 542, 1744, 522, 558, 542, 1744, 520, 1714, 542, 566, 544, 1714, 548, 1716, 520, 1714, 546, 1716, 522, 1714, 548, 1714, 544, 558, 572, 558, 580, 526, 544, 584, 520}; // NEC_LIKE 6A445BF0
uint32_t address = 0x2256;
uint32_t command = 0x0;
uint64_t data = 0x6A445BF0;