Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: Teensy 4.0 and Wire2

  1. #1
    Junior Member
    Join Date
    Sep 2018
    Posts
    8

    Teensy 4.0 and Wire2

    Hi
    I'm, working with Teensy4.0
    I am trying to connect the Qwiic Alphanumeric Display via I2c port.
    When it connected to SDA1/SCL1=Wire1 or SDA0/SCL0=Wire it works fine.
    I need to connect it to SDA2(25)/SCL2(24)=Wire2.
    that's when things don't work, I soldered (carefully) 2 wires to the Teensy4.0 (24 and 25) pads and connected them to the display. But I get a message that the display isn't connected
    ------------------------------------------------
    The code is very simple:
    Code:
    #include <Wire.h>
    #include <SparkFun_Alphanumeric_Display.h>
    HT16K33 display;
    void setup()
    {
      Serial.begin(115200);
      while(!Serial);
      Serial.println("Qwiic Alphanumeric examples");
      Wire2.begin(); //Join I2C bus
      //Wire2.setSDA(25);
      //Wire2.setSCL(24);
      if (display.begin() == false)
      {
        Serial.println("Device did not acknowledge! Freezing.");
        while (1);
      }
      Serial.println("Display acknowledged.");
      display.print("MILK");
      delay(2000);
    }
    void loop()
    {
      display.print("KEYS");
      delay(100);
    }
    ------------------------------------------------
    Results:
    Code:
    Qwiic Alphanumeric examples
    Device did not acknowledge! Freezing.

  2. #2
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    6,940
    I have not tried their display, but you need to tell their library to use Wire2 and not Wire.
    Looking at their header file I see:
    Code:
    bool begin(uint8_t addressLeft = DEFAULT_ADDRESS,
                   uint8_t addressLeftCenter = DEFAULT_NOTHING_ATTACHED,
                   uint8_t addressRightCenter = DEFAULT_NOTHING_ATTACHED,
                   uint8_t addressRight = DEFAULT_NOTHING_ATTACHED,
                   TwoWire &wirePort = Wire); // Sets the address of the device and opens the Wire port for communication
    so you might try changing your begin above to:
    Code:
    if (display.begin(DEFAULT_ADDRESS, DEFAULT_NOTHING_ATTACHED,DEFAULT_NOTHING_ATTACHED,DEFAULT_NOTHING_ATTACHED, Wire2) == false)

  3. #3
    Junior Member
    Join Date
    Sep 2018
    Posts
    8
    Thank you !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •