Actually, it is somewhat difficult and often impossible to make many 3rd party libraries with a software based i2c library.
It depends on how the library code that uses i2c is written whether or not it will work with a software i2c library.
Even when it does work, there can be limitations - more on that later.
In terms of software I2C libraries I prefer SoftwareWire over SoftI2CMaster for these reasons:
-
SoftwareWire is in the library manager so it is easier to install
-
SoftwareWire uses a nice clean GPL v3.0 license.
-
The licensing is a problem with SoftI2CMaster.
SoftI2CMaster is claiming to use CC-BY-SA 3.0 - which is a TERRIBLE license for s/w.
CC-BY-SA 3.0 is not compatible with anything but itself. So technically it is not legal to mix it with anything but other CC-BY-SA 3.0 code. This means that it can't be linked with any LGPL, GPL, BDS, apatchie, ..... etc. It can only be linked with other CC-BY-SA 3.0
So while you can use it for personal use it can never be used in a real project.
CC-BY-SA 4.0 was created to resolve this by allowing the license to convert into LGPL or GPL if linked against other code with those licenses. But once it converts, any updates made to that code must remain LGPL or GPL.
Looking deeper, these two libraries share some original code it isn't clear that CC-BY-SA 3.0 is even possible. -
SoftwareWire works with my hd44780 library
I haven't tracked down why but SoftI2CMaster doesn't work properly with hd44780.
In terms of using a 3rd party library with a software library there are several issues the main one being that many hard code using the Wire library and include <Wire.h> which means that there is no way to change this.
hd44780_I2Cexp does not do this so you can use a software i2c library.
However..... At this point in time the i2c object must compatible with the Wire library and be called Wire.
So to use SoftwareWire with hd44780_I2Cexp all you have to do is change this in your sketch:
#include <Wire.h>
to
#include <SoftwareWire.h>
SoftwareWire Wire(your-sdapin, your-sclpin);
And it will work.
It is useful if you want to use the existing i2c pins for something else but not very useful if you want to use the software wire bus and the hardware wire bus.
The issue is that currently hd44780_I2Cexp assumes an object named Wire.
Because of this it creates the limitation that you can't use both the Wire library and SoftwareWire in the same sketch.
At some point I plan on updating the hd44780_I2Cexp code to use a template so that you can pass in the name of the i2c object but that is not there today.
--- bill