Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. Ab13Akl
    3. Best
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Best posts made by Ab13Akl

    • Failure in library "TSL2561-Arduino-Library"

      Hi,
      i'm using the sensor TLS2561 and NodeManager 1.7. I installed the libraray "TSL2561-Arduino-Library" as it is described in the README.md.
      The function TSL2561::begin returns always true notwithstanding if the address mode (TSL2561_ADDR_HIGH|FLOAT|LOW) not matches the hardware setting of the address line (high|floating|low).

        Wire.requestFrom(_addr, 1);
      #if ARDUINO >= 100
        int x = Wire.read();
      #else
        int x = Wire.receive();
      #endif
        //Serial.print("0x"); Serial.println(x, HEX);
        if (x & 0x0A ) {
          //Serial.println("Found TSL2561");
        } else {
          return false;
        }
        _initialized = true;
      

      So, if the address matches the TLS2561 anwers with 0x0A. If the address does not match the I2C bus will read as 0xFF. In this case the statement "if (x & 0x0a)" will also be true.
      I changed the statement to "if (x == 0x0A)" and the function works correctly.
      @user2864 Maxbe you could intiate a change in the library. I don't know how to do that in the github environment.
      Greatings from germany, mabe with a special german english😌

      posted in NodeManager
      Ab13Akl
      Ab13Akl