How to do an I2C Read in C?

578 views Asked by At

I'm trying to get the pressure from a sensor using I2C but I'm not sure on the C code. So far I have this:

I2C1_MasterRead(&PressureData, 2, I2C_ADDR_DS, &status);

Where Pressure data is an 8 bit unsigned integer, the data is 2 bytes long, the address of the sensor, followed by what I think is a stop bit.

Does anyone have experience and can help me out?

0

There are 0 answers