I have captured the data my IR remote sends when I press a certain button on it, now I can't figure out how to send a copy of that data using my IR transmitter.
I'm using the library IRemote and my receiver and transmitter are compatible with that library. (I've used them successfully to copy IR codes from other remotes in the past.)
Here is the captured button press:
START /home/fedora/Arduino/libraries/IRremote/examples/ReceiveDump/ReceiveDump.ino from Sep 22 2021
Using library version 3.3.0
Ready to receive IR signals at pin 2
Protocol=PULSE_WIDTH Address=0x0 Command=0x0 Raw-Data=0x1F0 9 bits LSB first
Raw result in internal ticks (50 us) - with leading gap
rawData[22]:
-65535
+ 119,- 79 + 20,- 20 + 20,- 20 + 20,- 20
+ 19,- 21 + 40,- 20 + 40,- 21 + 39,- 20
+ 39,- 21 + 39,- 21 + 19
Raw result in microseconds - with leading gap
rawData[22]:
-3276750
+5950,-3950 +1000,-1000 +1000,-1000 +1000,-1000
+ 950,-1050 +2000,-1000 +2000,-1050 +1950,-1000
+1950,-1050 +1950,-1050 + 950
Result as internal ticks (50 us) array - compensated with MARK_EXCESS_MICROS=20
uint8_t rawTicks[21] = {119,79, 20,20, 20,20, 20,20, 19,21, 40,20, 40,21, 39,20, 39,21, 39,21, 19}; // Protocol=PULSE_WIDTH Address=0x0 Command=0x0 Raw-Data=0x1F0 9 bits LSB first
Result as microseconds array - compensated with MARK_EXCESS_MICROS=20
uint16_t rawData[21] = {5930,3970, 980,1020, 980,1020, 980,1020, 930,1070, 1980,1020, 1980,1070, 1930,1020, 1930,1070, 1930,1070, 930}; // Protocol=PULSE_WIDTH Address=0x0 Command=0x0 Raw-Data=0x1F0 9 bits LSB first
uint16_t address = 0x0;
uint16_t command = 0x0;
uint32_t data = 0x1F0;
Pronto Hex as string
char ProntoData[] = "0000 006D 000B 0000 00E6 0097 0027 0026 0027 0026 0027 0026 0025 0028 004E 0026 004E 0028 004C 0026 004C 0028 004C 0028 0025 06C3 "
I've tried it like this:
#include <Arduino.h>
#include <IRremote.h>
#define IR_SEND_PIN 10
#define LIGHT_ON_IR_DATA 0x1F0
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(115200);
IrSender.begin(IR_SEND_PIN, ENABLE_LED_FEEDBACK);
delay(2000);
Serial.print("Ready to send IR signals at pin ");
Serial.println(IR_SEND_PIN);
}
void loop() {
Serial.println("Send LIGHT_ON IR code");
IrSender.sendNECRaw(LIGHT_ON_IR_DATA, 0);
Serial.print("Sleeping for 1 sec");
delay(1000);
}
I also tried using the rawData using the rawSend method, but it expects a frequency as the third parameter and I have no clue what I would put in there.
