Hello I was curious for an arduino board like the uno is there a such thing as software i2c? I know for hardware there is a hardware spi and a software spi. But I wasn’t sure if there is a suck thing as software i2c. I see a lot of people talking about and about bit banging to make it work. However I was clueless and through I ask here after my searching.
Hey @UKHeliBob long story short is I have two bmp280 that I can’t change the address I. The
Even though I know they have two addresses. On the device there is only 4 pins for power ground sda and scl. Nothing else. On my other bmp280 they have also 3 pins I can cut the trace on one side and solder bridge to the other pad to give me the other address. However on this one’s. There is no pads on the board to do that and they are stuck with one address.
I don’t have a i2c multiplexer or I would use it. To get one in would take 4 to 5 days from Amazon. I’m in the middle of nowhere for only 2 days left and it doesn’t make sense to order one.
I have not heard of software i2c and that is why I came in here.
The technique is to set the DDR bits for the SDA / SCL lines as an Input and write 0 to the PORT bits. This configuration emulates the pin tri-stated and the line will be pulled up by the external resistor. Then switching DDR to Output when the line is to be pulled Low.
@UKHeliBob To make it simple and it’s just to test things out the other way I was thinking is since the boards are small on a breadboard that I can use two of them and just talk to each in software serial just having one sensor on one board and the other sensor have on the other board.
All I’m doing is testing out some new code I have learning to see if it will work and to include two boards instead of one is not so hard for me anymore. What do you think?
In my code all I’m doing is testing the temperature and humidity to see the difference between them then logging it. That’s all. It’s not a permanent project just for testing code.
That depends on what you want to do.
In I2C one is a master and the other a slave. Only the master can initiate a communication
In serial, either can transmit any time it wants.
Then you must also consider distance between the Arduinos.