2

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

  • Sure, the main `loop()` function is also nothing but, well, a function. All operations can be performed from everywhere, as long as their sequence is still the same. – PMF Jan 21 '22 at 12:18

0 Answers0