Hi all,
i am using twi_scanner and twi_sensor as templates to get data from CCS811 Air Quality sensor with PCA10040 and SDK 15.3.
But i cannot get the data printed in putty for example.
I believe the issue could be on my set_mode() function, in which i try to set measurements every one second and instantiate the data register.
But putty is not showing anything.
Here is my set_mode function.
/** * @brief Function for setting constant mode * Measurements every second */ void set_mode(void) { ret_code_t err_code; //Setting values of specific bits of the register byte /* Writing to CCS811_REG_CONF "1" set sensor in NORMAL mode. */ uint8_t reg[2] = {CCS811_REG_MEAS_MODE, 1U }; err_code = nrf_drv_twi_tx(&m_twi, device_id, reg, sizeof(reg), false); APP_ERROR_CHECK(err_code); while (m_xfer_done == false); NRF_LOG_INFO(" ************************************ "); NRF_LOG_INFO("Setting data pointer."); /* Writing to pointer byte. */ reg[0] = CCS811_REG_ALG_RESULT_DATA ; m_xfer_done = false; err_code = nrf_drv_twi_tx(&m_twi, device_id, reg, 1, false); APP_ERROR_CHECK(err_code); while (m_xfer_done == false); }
Thanks,