Hi all,
I'm currently working with an OPT4001 ambient light sensor and need to interface it with an RT1170 using I2C. My goal is to continuously read a specific value from the result register of the OPT1170. I am relatively new to RT1170 boards and I2C. I am using MCUXpresso and the SDK example "evkmimxrt1170_lpi2c_polling_b2b_master_cm7."
Could anyone guide me on how to correctly achieve this and retrieve values from the sensor? I have attached the datasheet of the OPT4001 for reference. Any assistance would be greatly appreciated.
Thank you.
Hi @sajithdevidas,
The evkmimxrt1170_lpi2c_polling_b2b_master_cm7 would be a good starting point, but considering that you probably will use the continuous mode (as you mentioned that you wish "to continuously read a specific value from the result register"), I would use the evkbmimxrt1170_lpi2c_interrupt_cm7 instead, and have RT receive the data by interruptions rather than polling.
This way, the INT pin can be used to detect incoming data and read it with the RT1170
I hope this helps.
BR,
Edwin.