Coder Social home page Coder Social logo

Comments (6)

direk avatar direk commented on August 20, 2024 3

One more thing - when I am sending NEC codes to my TV from ESP it works fine, so it looks like code need some tweaks after porting, or aircon is very sensitive for every disruption (length of signal for zeros and ones).

---edit---
I will try one more thing today - as I/O pins on ESP8266 can deliver only 12mA of current, I'll try to power IR LED directly from 3V3 by using transistor. Maybe 12mA is not enough and some devices cannot capture signal from LED...

---edit---
Problem fixed - driving led thru transistor helped. It looks like 12mA directly from IO pin is not enough for my IR LED to be recognized by AC.

It also shows that other protocols can be ported directly by copying corresponding functions :)

from irremoteesp8266.

markszabo avatar markszabo commented on August 20, 2024

Well can you send the code from the Arduino? I think, maybe your LED has a slightly different frequency then the receiver of the airconditioner

from irremoteesp8266.

direk avatar direk commented on August 20, 2024

The same LED and the same code on oryginal arduino board and oryginal IR library works fine. I have no idea what is wrong.

from irremoteesp8266.

chaeplin avatar chaeplin commented on August 20, 2024

@direk Thank you for your tip.

from irremoteesp8266.

gorec2005 avatar gorec2005 commented on August 20, 2024

Hi!
this code work for me:
in IRremoteESP8266.cpp
...
void IRsend::sendNEC(unsigned long data, int nbits)
{
enableIROut(38);
mark(NEC_HDR_MARK);
space(NEC_HDR_SPACE);
for (int i = 0; i < nbits; i++) {
if (data & TOPBIT) {
mark(NEC_BIT_MARK);
space(NEC_ONE_SPACE);
}.
else {
mark(NEC_BIT_MARK);
space(NEC_ZERO_SPACE);
}
data <<= 1;
}
mark(NEC_BIT_MARK);
space(0);
}

void IRsend::sendLG (unsigned long data, int nbits)
{
enableIROut(38);
mark(LG_HDR_MARK);
space(LG_HDR_SPACE);
mark(LG_BIT_MARK);
for (unsigned long mask = 1UL << (nbits - 1); mask; mask >>= 1) {
if (data & mask) {
space(LG_ONE_SPACE);
mark(LG_BIT_MARK);
} else {
space(LG_ZERO_SPACE);
mark(LG_BIT_MARK);
}
}
space(0);
}

void IRsend::sendWhynter(unsigned long data, int nbits) {
...

and off course in IRremoteESP8266.h

void sendNEC(unsigned long data, int nbits);
void sendLG(unsigned long data, int nbits);
void sendSony(unsigned long data, int nbits);

from irremoteesp8266.

markszabo avatar markszabo commented on August 20, 2024

Ok, thanks, I added your function. Next time you may issue a pull request, which would make my work easier and give you proper credits (but I still wrote your name in the commit message).

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.