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

1
  • 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. Commented Jan 21, 2022 at 12:18

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.