Problem: SOLVED!
For RAW lenght < 255 bit:
Open IRremoteInt.h in the last IRRemote library version
Edit the #define RAWBUF value from 101 to 255
Edit the #define _GAP value from 5000 to 20000
If your RAW is longhest than 255, you need to edit the unit from 8 bit to 16 bit.
BUT in this case i find a good sketch for extract the RAW (see the link below):
http://www.analysir.com/blog/2014/03/19 ... s-arduino/With a mod version of it i read my code of 349 bits and it work fine.
Code:
/*
Author: Stefano Martino
Versione: 1.1 - 11 dec 2019
With this AnalysIR mod you can read long raw IR Remote codes used tipically on Airconds and hvac systems.
The extracted RAW can pasted directly on the Coocking Hacks SEND Sketch, without any other mods.
NOTE: for some aircon isn't necessary to repeate the code!
Credit: Copyright AnalysIR 2014-2019
http://www.analysir.com/blog/2014/03/19/air-conditioners-problems-recording-long-infrared-remote-control-signals-arduino/
PINOUT (only tested on Arduino UNO):
Receiver IR Arduino
V+ -> +5v
GND -> GND
Signal -> Digital Pin 2
*/
#define maxLen 800
#define rxPinIR 2
volatile unsigned int irBuffer[maxLen];
volatile unsigned int x = 0;
void setup() {
Serial.begin(115200);
attachInterrupt(digitalPinToInterrupt(rxPinIR), rxIR_Interrupt_Handler, CHANGE);
delay(500);
Serial.print("Press a key (once) and wait...");
Serial.println();
}
void loop() {
delay(3000);
if (x) {
Serial.println();
Serial.print(F("OK!"));
Serial.println();
Serial.println();
delay(500);
Serial.print(F("Below are coded "));
Serial.print((x - 1));
Serial.print(F(" [RAW] pulses: "));
Serial.println();
Serial.println();
delay(2000);
detachInterrupt(digitalPinToInterrupt(rxPinIR));
for (int i = 1; i < x; i++) {
if (!(i & 0x1)) {
Serial.print(F("delayMicroseconds("));
} else {
Serial.print(F("pulseIR("));
}
Serial.print(irBuffer[i] - irBuffer[i - 1]);
Serial.print(F(");"));
Serial.println("");
}
x = 0;
Serial.println("");
Serial.println("Ready for another key...");
attachInterrupt(digitalPinToInterrupt(rxPinIR), rxIR_Interrupt_Handler, CHANGE);
}
}
void rxIR_Interrupt_Handler() {
if (x > maxLen) return;
irBuffer[x++] = micros();
}
Stefano