RAK3172 + RUI3 + Wire (I2C)

Hi,

Greetings!

This is in reference to Wire (I2C) protocol and interfacing sensor with RAK3172 over Wire (I2C).
Please note that we are trying to interface 2 different sensor to RAK3172.
Out of these 2 sensors, 1 sensor is having requirement of making I2C Pin (SDA and SCL) high or low depending upon it’s configuration and does not require I2C further.
In other sensor’s case, after initialization this sensor needs I2C to read event data from it.

So to have this functionality we re-inits I2C to read event data.
However this is not working as when try to put I2C SDA pin low it does not.

Can you please confirm whether this is possible with RAK3172?

Regards,

Dinesh

Answered in your other inquiry already:

The Wire library will control SDA and if there is no transmission, the pin is set as input. So if you need to manually control SDA, you have first to change its mode.
I tried

void setup()
{
	Wire.begin();
}

void loop()
{
	pinMode(PIN_WIRE_SDA, OUTPUT);
	Serial.println("SDA low");
	digitalWrite(PIN_WIRE_SDA, LOW);
	delay(5000);
	Serial.println("SDA high");
	digitalWrite(PIN_WIRE_SDA, HIGH);
	delay(5000);
	// api.system.sleep.all();
}

And it toggles the SDA pin.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.