I2C Outputting Data


I am trying to use a PixHawk 4 for a testing setup that I need to be able to read the accelerometer and gyro data through the I2C port(s) (I am not partial to using the I2C A or B ports). I am struggling to find any documentation or examples of using the PixHawk 4 as a I2C Slave. Additionally, I can’t find whether the PixHawk 4 is capable of Multi-Master I2C operation. My testing setup is currently utilizing LabVIEW and a NI USB-8451 for my PC to act as the I2C master.

So my primary question is: Are either of these options possible with the PixHawk 4?

If the answer to this question is yes, what would be useful to know to get started? I am already using several I2C slave devices on the same bus so I am not completely helpless with the I2C interface but I feel slightly “out of my wheelhouse”, so any assistance is appreciated.


Not really sure what you are trying to do. Are you testing PixHawk 4 and I2C devices connected to it? Is the issue that PixHawk 4 and your USB-8451 are both I2C masters? if this is true, you should put USB-8451 in “monitor/slave” mode.

I don’t think the PX4 I2C driver has the capability to work as a slave, but if you know C++ and embedded you can change the I2C driver inside PX4.