felias-fogg / SoftI2CMaster

Software I2C Arduino library
GNU General Public License v3.0
368 stars 100 forks source link

available returns a number even when no device is attached #37

Closed lpatiny closed 2 years ago

lpatiny commented 6 years ago

Thanks for your very useful library !

I'm using SoftWire with the following flags on a home made Leonardo Lilipad Pro (Atmega 32u4 at 8MHz):

#define I2C_HARDWARE 1
#define I2C_TIMEOUT  10
#define I2C_SLOWMODE 1

When I use the following code:

Wire.requestFrom(address, 2);
Serial.println(Wire.available());

I always have the value '2' even when the device is not connected. I would expect '0' if nothing is return (and if the device is not connected) which is the result obtained with the native Wire library.

felias-fogg commented 3 years ago

I now got a "Leonardo"-alike and will check that.

felias-fogg commented 2 years ago

Well, this should be fixed with the 2.1.9