can data from a sensor be read in a function

88 Views Asked by At

I am using the icm 20948 sensor, programming on MPLABx running harmonyV3.i2c is communication mode. Can I read and write in a function, does it have to be in a while loop?

For example would:

while(SERCOM1_I2C_IsBusy()) {}
SERCOM1_I2C_Write(ICM20948_ADDRESS,&FAccrangefactor, 1);

function properly in a function. Many thanks

0

There are 0 best solutions below