Help getting 2 OLED displays to show 2 different Probe Temps over I2C

Hello All,

Not a newbie but certainly not that great at programming Arduinos.

I am working on a project to have 2 different DS18B20 temp probes to display the temperature on 2 different OLED displays, using one UNO and the SSD1306 multiplexer.

In te code attached the temp probes read and display each probe on the serial monitor. The problem comes when trying to send the temp from probe 1 to OLED #1 and the temp from probe 2 to OLED #2. Currently OLED #1 is scrolling through the temp probe readings.

In the code attached, I would like one OLED to only display a single probes temperature readings. Can anyone help me?

I've sat for a bunch of hours wondering what Ive done wrong but just dont think I have the knowledge to figure this out on my own and every sketch I google is either for serial display or having multiple sensors to a single screen.

Please help!!!!

#include <Wire.h>  //I2C library

#include <SPI.h>  //OLED library

#include <Adafruit_GFX.h>
#include <Adafruit_GrayOLED.h>
#include <Adafruit_SPITFT.h>
#include <Adafruit_SPITFT_Macros.h>
#include <gfxfont.h>

#include <Adafruit_SSD1306.h>
#include <splash.h>

//22:56:08.118 -> Sensor 1 : 0x28, 0x4E, 0xFF, 0x56, 0xB5, 0x01, 0x3C, 0x30
//22:56:08.184 -> Sensor 2 : 0x28, 0xFF, 0xCC, 0x26, 0xA2, 0x17, 0x04, 0x68
//22:56:08.252 -> Sensor 3 : 0x28, 0xFF, 0x91, 0x4A, 0xA0, 0x16, 0x03, 0x9B

#include <OneWire.h>
#include <DallasTemperature.h>

// Data wire is plugged into port 2 on the Arduino
#define ONE_WIRE_BUS 2

// Setup a oneWire instance to communicate with any OneWire devices
OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);


#define OLED_RESET 4  // Reset pin not used but needed for library
#define I2C_ADDR 0x3F //Hexadecimal address of Multiplexer

// Addresses of 3 DS18B20s
DeviceAddress sensor1 = { 0x28, 0x4E, 0xFF, 0x56, 0xB5, 0x01, 0x3C, 0x30 };
DeviceAddress sensor2 = { 0x28, 0xFF, 0xCC, 0x26, 0xA2, 0x17, 0x04, 0x68 };
DeviceAddress sensor3 = { 0x28, 0xFF, 0x91, 0x4A, 0xA0, 0x16, 0x03, 0x9B };

///                                    ********OLED Display**********
//Adafruit_SSD1306 display(-1);
// Create an object for each OLED display
Adafruit_SSD1306 display2(OLED_RESET);
Adafruit_SSD1306 display3(OLED_RESET);

void TCA9548A(uint8_t i)  //Adafruit channel selection function
{
  Wire.beginTransmission(0x70);  // TCA9548A address is 0x70
  Wire.write(1 << i);          // send byte to select bus
  Wire.endTransmission();
}

void displayTemp(float tem){  
  // Clear the display
  display2.clearDisplay();
  //Set the color - always use white despite actual display color
  display2.setTextColor(WHITE);
  //Set the font size
  display2.setTextSize(2);
  //Set the cursor coordinates
  display2.setCursor(0,10);
  display2.print("T: "); 
  display2.print(tem);
  display2.print(" C");
}
//////////////////////////////////////SETUP/////////////////////////////////////////////////////////////
void setup(void)
{
  ///                                 *************Temp Sensors***********
  Serial.begin(9600);
  sensors.begin();
  // Start Wire library for I2C
  Wire.begin();
///                                    ********OLED Display**********
  // initialize with the I2C addr 0x3C
  //display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  
  // Set multiplexer to channel 2 and initialize OLED-0 with I2C addr 0x3C
  
  TCA9548A(2); 
display2.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  // Clear the display


  display2.display();  // Show initial display buffer contents on the screen --
  delay(2000); // Pause for 2 seconds    // the library initializes this with an Adafruit splash screen.
 
  // Clear the buffer.
  display2.clearDisplay();
  
  // Draw a single pixel in white
  display2.drawPixel(10, 10, WHITE);

  // Show the display buffer on the screen. You MUST call display() after
  // drawing commands to make them visible on screen!
  display2.display();
  delay(2000);
  // display.display() is NOT necessary after every single drawing command,
  // unless that's what you want...rather, you can batch up a bunch of
  // drawing operations and then update the screen all at once by calling
  // display.display(). These examples demonstrate both approaches...

 // Addresses of 3 DS18B20s
sensors.setResolution(sensor1, 10);
sensors.setResolution(sensor2, 10);
sensors.setResolution(sensor3, 10);
  
  
}
//////////////////////////////////////////////// LOOP ///////////////////////////////////////////////////
void loop(void)
{
  ///                                       *************Temp Sensors***********
 sensors.requestTemperatures();
  
  Serial.print("Sensor 1a: ");
  printTemperature(sensor1);
  
  Serial.print("Sensor 2a: ");
  printTemperature(sensor2);
  
  Serial.print("Sensor 3a: ");
  printTemperature(sensor3);
  
  Serial.println();
  delay(1000);
}

void printTemperature(DeviceAddress deviceAddress)
{
  float tempC = sensors.getTempCByIndex(0);
  Serial.print(tempC);
  //Serial.print((char)176);
  Serial.print("C  |  ");
  Serial.print(DallasTemperature::toFahrenheit(tempC));
  //Serial.print((char)176);
  Serial.println("F");

 ///                                           ********OLED Display**********
  TCA9548A(2);
displayTemp(tempC);
  display2.display();   // Set multiplexer to channel 1 and display temperature
  



  
}