Go Down

Topic: Request in Wire.h library (Read 224 times) previous topic - next topic


Jun 27, 2017, 08:09 pm Last Edit: Jun 27, 2017, 09:35 pm by vanakaru
I have run into a obstacle with using Wire.h.
I have 4 boards/addresses on I2C bus. I need to be able to remove some of these boards on the fly or start with only part of these attached.

If I understand this at all:
As it is now Wire.h is initialising

If true, requestFrom() sends a stop message after the request, releasing the I2C bus.

If false, requestFrom() sends a restart message after the request. The bus will not be released, which prevents another master device from requesting between messages. This allows one master device to send multiple requests while in control.

The default value is true.

In my case if even one board is missing I2C bus will not be released and the system is stuck. Would it be possible to modify the library so that requestFrom() would be sent limited times(once) and not with while();?


The libraries are distributed in source code form. Look in your documents dir in arduino/libraries.

Go Up