Coder Social home page Coder Social logo

Comments (6)

markszabo avatar markszabo commented on August 20, 2024

Hello,

can you try it with a normal arduino and the original library?

You may also try to change the constants RC5_T1 and RC5_RPT_LENGTH in IRremoteInt.h to get better results. I would start with decreasing their value a bit, but I'm not 100% sure.

Mark

from irremoteesp8266.

axwell avatar axwell commented on August 20, 2024

Tested with arduino uno and original library works fine.
EDIT: Hmm seems like one buton of the remote has 2 values.
EX: power on / off - 2060 and 12 if i alternate these it works !

Do you have any idea why 1 button has 2 codes ?

from irremoteesp8266.

markszabo avatar markszabo commented on August 20, 2024

Wow, that's kind a new for me, and no, sorry, I have no idea why it has two codes. Does it work if you send both codes after each other?

from irremoteesp8266.

renno-bih avatar renno-bih commented on August 20, 2024

That is how RC5 works. You need to put toggle bit into code to send it...
That is how I implemented it:

else if (type_json == RC5 || type_json == RC6) {  //Implementation of sending RC5/RC6 codes

    // Flip the toggle bit for a new button press
    if (repeat) {
      toggle = 1 - toggle;
    }

    // Put the toggle bit into the code to send
    codeValue_json = codeValue_json & ~(1 << (bits_json - 1));
    codeValue_json = codeValue_json | (toggle << (bits_json - 1));
    if (type_json == RC5) {
#if DEBUG
      Serial.print("Sent RC5 ");
      Serial.println(codeValue_json, HEX);
#endif
      irsend.sendRC5(codeValue_json, bits_json);
    }
    else {
      irsend.sendRC6(codeValue_json, bits_json);
#if DEBUG
      Serial.print("Sent RC6 ");
      Serial.println(codeValue_json, HEX);
#endif
    }
  }

I also store last code value to check if it is the same as new value. If it is I set repeat to 1.

from irremoteesp8266.

markszabo avatar markszabo commented on August 20, 2024

Wow nice. If you think it's better than the actual one in the library, you are more than welcome to issue a pull request :)

from irremoteesp8266.

renno-bih avatar renno-bih commented on August 20, 2024

This is something that is implemented in executing sketch, not in library.
In official library there is also example that shows how to implement it. Here it is:
https://github.com/z3t0/Arduino-IRremote/blob/master/examples/IRrecord/IRrecord.ino

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.