Wire library without I2C Hangup bug

Status
Not open for further replies.

lkiss10

Member
Hello,

I am struggling with I2C bus. The complete program hangs up, if the I2C unit is not available. As I have learnt it is a bug in the Wire library. A new version was just released, but I dont know, how to use it.
https://www.fpaynter.com/tag/i2c-freeze/

There are 2 wire library in my installation:

Arduino\hardware\teensy\avr\libraries\Wire
Arduino\hardware\arduino\avr\libraries\Wire

Probably the 1st is used by the compiler. Can I just replace it with the new library? Or?

Thanks, Laszlo
 
Teensy's version of the Wire library fixed this problem years ago.

If you're using a Teensy, just look at the messages Arduino prints about which library it's using. If you're using the copy in {Arduino}\hardware\teensy\avr\libraries\Wire then you have this fix and a lot of other improvements which still aren't part of Arduino's library.
 
Hello Paul,

Thanks for the quick reply. I have checked, and it uses the wire library from teensy library. So I dont know, what can be the issue. I use this library: https://github.com/jarzebski/Arduino-INA226 for some current sensors. I have 3 Teensy 4.0 with some INA226 boards, and they work well. However now I have made something wrong with the 4th Teensy and the connected INA boards, so if I call the current read function the complete program stops. If I comment out this line, the rest of the program works well. I will check the hardware, but independently from the hardware issue, the program should not stop, if the Teensy cannot reach the I2C board.

Laszlo
 
Status
Not open for further replies.
Back
Top