I think I'm getting somewhere, but for some reason the data that I send is off a little bit.
Here is what I receive when I send it form one Arduino to the other Arduino:
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
+ 117,- 80 + 19,- 21 + 19,- 21 + 19,- 21
+ 19,- 22 + 37,- 22 + 39,- 21 + 39,- 21
+ 38,- 23 + 37,- 23 + 18
Raw result in microseconds - with leading gap
rawData[22]:
-3276750
+5850,-4000 + 950,-1050 + 950,-1050 + 950,-1050
+ 950,-1100 +1850,-1100 +1950,-1050 +1950,-1050
+1900,-1150 +1850,-1150 + 900
Result as internal ticks (50 us) array - compensated with MARK_EXCESS_MICROS=20
uint8_t rawTicks[21] = {117,80, 19,21, 19,21, 19,21, 19,22, 37,22, 39,21, 39,21, 38,23, 37,23, 18}; // 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] = {5830,4020, 930,1070, 930,1070, 930,1070, 930,1120, 1830,1120, 1930,1070, 1930,1070, 1880,1170, 1830,1170, 880}; // 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 00E2 0099 0025 0028 0025 0028 0025 0028 0025 002A 0048 002A 004C 0028 004C 0028 004A 002B 0048 002B 0023 06C3 "
Using that code:
#include <Arduino.h>
#include "PinDefinitionsAndMore.h"
#include <IRremote.h>
////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////Captured IR data (from the original remote)////////////////////
////////////////////////////////////////////////////////////////////////////////////////
// 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 ";
////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
#define IR_SEND_PIN 13
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(115200);
IrSender.begin(IR_SEND_PIN, ENABLE_LED_FEEDBACK); // Specify send pin and enable feedback LED at default feedback LED pin
}
void loop() {
const uint8_t NEC_KHZ = 38; // 38kHz carrier frequency for the NEC protocol
uint16_t irSignal[] = {5930,3970, 980,1020, 980,1020, 980,1020, 930,1070, 1980,1020, 1980,1070, 1930,1020, 1930,1070, 1930,1070, 930};
Serial.println("SEND IR CODE");
IrSender.sendRaw(irSignal, sizeof(irSignal) / sizeof(irSignal[0]), NEC_KHZ);
delay(5000);
}
As you can see the first byte of the rawTicks array is 119 when I send it, but when i receive it I get 117.