SDA pin

Hey everybody. This is my first post. I looked every where for info on this, but couldnt find anything. Any help would be greatly appreciated. Thank you in advance.

I'm trying to use 2x Lora ESP 32 v2 (with wifi and oled screen) from www.Heltec.cn to remotely monitor a temperature sensor (MLX90614).

I dont plan on using the wifi or bluetooth feature, just the 433 mhz radio to send data (temperature readings) from one board to the other.

I've established radio data transfer between the two. but my question has to do with integrating the temperature sensor. Looking at the sample sketch for the MLX90614, i think the sensor uses the serial data (SDA) pin and SCL pin.

But the sample sketch of the LoRa ESP 32 board shows that it also uses SDA, SCL, and RST pins for the OLED screen.

My question is can I use these two components together? Do I need to assign a different pin as SDA and SCL for the temp sensor?

Here are reference links and snippets of the sample sketches.

Thank you for your help.

LoRa ESP 32 v2

MLX90614 IR Temp Sensor

Here's the first part of the sample sketch for the MLX90614:

#ifdef CALUNIUM
#include

uint8_t sdaPin = 16; // JTAG TDI
uint8_t sclPin = 19; // JTAG TCK
uint8_t powerPin = 18;
#elif defined(ARDUINO_ARCH_AVR)
uint8_t sdaPin = A4;
uint8_t sclPin = A5;
#else
// Adjust to suit your non-AVR architecture
uint8_t sdaPin = 0;
uint8_t sclPin = 1;
#endif

The sketch for the LoRa board includes heltec.h, which includes SSD1306Wire.h. Here are pieces of those sketches:

OLED Lora radio transmitter board:
In the // notes it says:
OLED pins to ESP32 GPIOs via this connecthin:
OLED_SDA -- GPIO4
OLED_SCL -- GPIO15
OLED_RST -- GPIO16

Here is a piece of the code from the library file SSD1306Wire.h:

class SSD1306Wire : public OLEDDisplay {
private:
uint8_t _address;
uint8_t _sda;
uint8_t _scl;
uint8_t _rst;
bool _doI2cAutoInit = false;

public:
SSD1306Wire(uint8_t _address, uint8_t _sda, uint8_t _scl, uint8_t _rst, OLEDDISPLAY_GEOMETRY g = GEOMETRY_128_64) {
setGeometry(g);

this->_address = _address;
this->_sda = _sda;
this->_scl = _scl;
this->_rst = _rst;

3dchris:
But the sample sketch of the LoRa ESP 32 board shows that it also uses SDA, SCL, and RST pins for the OLED screen.

My question is can I use these two components together?

As long as they have unique addresses, yes.

3dchris:
Do I need to assign a different pin as SDA and SCL for the temp sensor?

No. Plug 'I2C' into your favorite search engine.

I2C is a bus.

Its designed to allow the SDA\SCL pins to be shared by different I2C devices.