Hi,
i wanted to i2c interface of nrf with adc ic 3427. i am trying to interface by refer example of twi_scanner device address get found correctly.
now i am trying to interface by refer example of twi_sensor but it not working.
please suggest me how to interface ADC ic3427 with nrf .
this is my code:
uint8_t reg[1] = {0x88};
err_code = nrf_drv_twi_tx(&m_twi, 0X6E, reg, sizeof(reg), false);
APP_ERROR_CHECK(err_code);
if(err_code == NRF_SUCCESS);
{
printf("sucess");
}
uint8_t ret[1] = {0xDD};
err_code = nrf_drv_twi_tx(&m_twi, 0X6E, ret, sizeof(ret), false);
APP_ERROR_CHECK(err_code);
if (err_code == NRF_SUCCESS);
{
printf("sucess2");
}
//adc_High = Wire.read();//I2C_Read();
//adc_Low = Wire.read();//I2C_Read();
err_code = nrf_drv_twi_rx(&m_twi, 0X6E, &m_sample, sizeof(m_sample));
APP_ERROR_CHECK(err_code);
NRF_LOG_INFO("data %d", m_sample);
printf("data_high %d", m_sample);
NRF_LOG_FLUSH();
err_code = nrf_drv_twi_rx(&m_twi, 0X6E, &n_sample, sizeof(n_sample));
APP_ERROR_CHECK(err_code);
NRF_LOG_INFO("data %d", n_sample);
printf("data_low %d", n_sample);
NRF_LOG_FLUSH();