Chat here about code rewrites, mods, etc... with respect to the github project https://github.com/esp8266/Arduino

Moderator: igrr

User avatar
By PaulDG
#19465 So, buried on page 2 of the comments of Ken Shirriff's blog post http://www.righto.com/2009/08/multi-protocol-infrared-remote-library.html?commentPage=2
is a comment from Suat Özgür
Here is a workaround to send() using any I/O pin and without using hardware PWM o

https://sui77.wordpress.com/2011/05/27/ ... -soft-pwm/


While his example libs were lost to the internet gods, I was able to use his examples to modify Ken's library to work with the esp8266.
I used an esp8266 01 to receive Ir codes over udp and transmit over Ir, I also used an esp8266 201 to receive Ir codes and send them over udp to the transmitter but I haven’t used a single 8266 for both receive and transmit.

I managed to get the transmitter working from his examples but the receiver was more difficult, I had to ditch his timing loop and go with a simple timer in the main loop. I ended up sampling at 41 micro seconds.
Code: Select allvoid loop() {
  if ( micros() - PointA > 41 ) {
    irrecv.pgti();
    PointA = micros();
  }
 
  if (irrecv.decode(&results)) {
    Serial.println(results.value);
    delay(800); // Stops Key Bounce
    irrecv.resume(); // Receive the next value
  }


PaulDG