Hello.
I am making a project using various sensors, two of them using SDA and SCL pins that I have to connect to A4 and A5 pins respectively.
When I upload the code, I guess the data gets mixed up due to them sharing the two pins and thus the information doesn't show up.
I would like to know if there is any way to change the Analog pins of one sensor (for example, sensor1 uses pins A4 and A5 for SDA and SCL; and sensor2 uses pins A3 and A2.
All the I2C sensors can use A4 and A5. You might use a breadboard to expand the number of pins I2C is available on.
Here is an ESP32 plugged into a breadboard with several devices using the SPI buss. To the left of the ESP32 is a bundle of connected wires where the SPI buss is brought out from the ESP32 to a spot on the breadboard, where multiple SPI devices are connected.
OK so far. All of the I2C devices are connected to SDA and SCL
Now you have gone wrong
Each I2C device has an address and will only put data onto the bus to be read when it is requested. It is possible that your two I2C devices have the same address. To find their address have you tried running an I2C scanner sketch ? There is one included with the Wire library
I tried includeing bmp.begin(); and now it works. I guess that was why it wasn't working. The !bme.begin I have eliminated because I don't need it for the project. Thanks!