Teensy 4.0 and Wire2

shmulik

Member
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.
 
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)
 
Back
Top