Coder Social home page Coder Social logo

Comments (8)

annhan avatar annhan commented on August 20, 2024

Hi josep112,
i can change
typedef struct {
uint8_t recvpin; // pin for IR data from detector
uint8_t rcvstate; // state machine
unsigned int timer; // state timer, counts 50uS ticks.
unsigned int rawbuf[RAWBUF]; // raw data
uint8_t rawlen; // counter of entries in rawbuf
}
irparams_t;

to
typedef struct {
uint8_t recvpin; // pin for IR data from detector
uint8_t rcvstate; // state machine
unsigned long timer; // state timer, counts 50uS ticks.
unsigned long rawbuf[RAWBUF]; // raw data
long rawlen; // counter of entries in rawbuf
}
irparams_t;
you can change rawbuf to 800 for all AIR (Daikin..).
Sketch leaning rawbuf 800 for arduino of Link analysir.com
#define LEDPIN 5
#define maxLen 800

volatile unsigned int irBuffer[maxLen]; //stores timings - volatile because changed by ISR
volatile unsigned int x = 0; //Pointer thru irBuffer - volatile because changed by ISR

void setup() {
Serial.begin(115200); //change BAUD rate as required
attachInterrupt(0, rxIR_Interrupt_Handler, CHANGE);//set up ISR for receiving IR signal
}

void loop() {
// put your main code here, to run repeatedly:

Serial.println(F("Press the button on the remote now - once only"));
delay(5000); // pause 5 secs
if (x) { //if a signal is captured
digitalWrite(LEDPIN, HIGH);//visual indicator that signal received
Serial.println();
Serial.print(F("Raw: (")); //dump raw header format - for library
Serial.print((x - 1));
Serial.print(F(") "));
detachInterrupt(0);//stop interrupts & capture until finshed here
for (int i = 1; i < x; i++) { //now dump the times
if (!(i & 0x1)) Serial.print(F("-"));
Serial.print(irBuffer[i] - irBuffer[i - 1]);
Serial.print(F(", "));
}
x = 0;
Serial.println();
Serial.println();
digitalWrite(LEDPIN, LOW);//end of visual indicator, for this time
attachInterrupt(0, rxIR_Interrupt_Handler, CHANGE);//re-enable ISR for receiving IR signal
}

}

void rxIR_Interrupt_Handler() {
if (x > maxLen) return; //ignore if irBuffer is already full
irBuffer[x++] = micros(); //just continually record the time-stamp of signal transitions

}
Sorry for my english
thank you

from irremoteesp8266.

josep112 avatar josep112 commented on August 20, 2024

Hi Annhan,
Thanks for the reply, I changed the code but did not work my code is below

#include <IRremoteESP8266.h>
long rawlen;
uint8_t RECV_PIN = 2; //an IR detector/demodulatord is connected to GPIO pin 2

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
}

void loop() {
if (irrecv.decode(&results)) {
Serial.println(results.value, HEX);
irrecv.resume(); // Receive the next value
}
delay(100);
}

from irremoteesp8266.

josep112 avatar josep112 commented on August 20, 2024

Sorry I had not seen the link, I could change my raw and went from 254 to 347 will test the air thanks for the help

from irremoteesp8266.

josep112 avatar josep112 commented on August 20, 2024

Hi Annhan,
Not quite understand what you need, you had said that does not speak in English which his country talves can talk in another language

from irremoteesp8266.

safari2 avatar safari2 commented on August 20, 2024

Hi all.

I've just solved the similar problem. The issue is only with long IR reading.
There are good solution with hardware interrupt driving reading: http://www.analysir.com/blog/2014/03/19/air-conditioners-problems-recording-long-infrared-remote-control-signals-arduino/
It works almost out of the box for ESP8266. Just change this code from 0 to your pin number (I used 12 (D4 on nodemcu aka lolin):

   attachInterrupt(0, rxIR_Interrupt_Handler, CHANGE);//set up ISR for receiving IR signal
   detachInterrupt(0);//stop interrupts & capture until finshed here
   attachInterrupt(0, rxIR_Interrupt_Handler, CHANGE);//re-enable ISR for receiving IR signal

So I've successfully got unsigned int rawData [439] for my Panasonic HVAC.
Than you can use irsend.sendRaw() from this library.

from irremoteesp8266.

helio58 avatar helio58 commented on August 20, 2024

So I've successfully got unsigned int rawData [439] for my Panasonic HVAC.
Than you can use irsend.sendRaw() from this library.

Please safari2 where is the irsend.sendRaw() ? and how to send the obtained code?
Thanks

from irremoteesp8266.

safari2 avatar safari2 commented on August 20, 2024

helio58, see link below.

from irremoteesp8266.

crankyoldgit avatar crankyoldgit commented on August 20, 2024

Closing this issue. Versions of the library later than v2.0 now support larger (256+) capture buffers.

from irremoteesp8266.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.