Git Product home page Git Product logo

Comments (2)

fingolfin avatar fingolfin commented on July 28, 2024

It's unclear to me from what you write what you tried to do, and what the problem was. Perhaps you can insert some snippets of code you tried to use, and explain what you thought it would do, and what happened instead. Then based on that, perhaps somebody can help you!

from rc-switch.

1technophile avatar 1technophile commented on July 28, 2024

Hello,

I was trying to implement 32 bit signal on OpenMQTTGateway based on this great library. I encountered problem when trying to work with other length than the traditional 24 that we are seeing on the examples.

Let's see the test I have done.

I modified this code to have some traces:

void RCSwitch::send(const char* sCodeWord) {
  // turn the tristate code word into the corresponding bit pattern, then send it
  unsigned long code = 0;
  unsigned int length = 0;
  for (const char* p = sCodeWord; *p; p++) {
    code <<= 1L;
    if (*p != '0')
      code |= 1L;
    length++;
  }
  Serial.println (code);
  Serial.println(length);
  this->send(code, length);
}

"test 1"
mySwitch.send("101000000010101010100");
from the trace I see --> code 1312084 length 21 --> KO plug state doesn't change
mySwitch.send("101000000010101010001");
from the trace I see --> code 1312081 length 21 --> KO plug state doesn't change

"test 2"
mySwitch.send(1312084,21);
--> KO plug state doesn't change
mySwitch.send(1312081,21);
--> KO plug state doesn't change

"test 3"
mySwitch.send(1312084,24);
--> OK plug state change
mySwitch.send(1312081,24);
--> OK plug state change

"test 4"
mySwitch.send("000101000000010101010100");
code 1312084 length 24 --> OK plug state change
mySwitch.send("000101000000010101010001");
code 1312081 length 24 --> OK plug state change

It seems that when we are not with a length of 24 we are not having the expected behavior. Do you have some infos about this?

from rc-switch.

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.