Hi,
I am working on NRF52840, I want to read some ADC (Potentiometer) using I2C communication in NRF52840 MCU, Can you please help me, how to implement the code for this.
Thanks
Hi,
I am working on NRF52840, I want to read some ADC (Potentiometer) using I2C communication in NRF52840 MCU, Can you please help me, how to implement the code for this.
Thanks
Hi,
If I understand you correctly, you want to read an external ADC device that is interfaced over I2C? I2C devices have different command set to read values, so you will have to look in the datasheet of your specific device which commands you need to send to read the data. You can start out with the TWI sensor example, which showcases how to interface a TWI/I2C sensor device.
Best regards,
Jørgen
Hi,
As now, I want to interface with potentiometer using I2C, After reading the potentiometer data I have to send through BLE.
Hi,
As now, I want to interface with potentiometer using I2C, After reading the potentiometer data I have to send through BLE.
Hi,
Yes, that is possible. You can either send the data over the Nordic UART Service (NUS), see UART/Serial Port Emulation over BLE example, or you can create your own custom service, see the Service and Characteristics tutorials.
We do not have any examples showing how to send I2C sensor data over BLE, but you can have a look at this example sending data from the internal SAADC peripheral over NUS.
Best regards,
Jørgen
Hi,
Thanks for the reply.
Can you please tel me how to vary the potentiometer values over I2c in nrf52840.Please
Can you please give me some sample code
We do not have any example code for that. You need to read the datasheet of the I2C device and implement the correct commands in your application to interface and configure the device.
ok sure,
Can you please give me sample code to read potentiometer.