/* User task that triggers measurements of sensor every seconds. It uses function  */
void user_task(void *pvParameters)
/* User task that triggers measurements of sensor every seconds. It uses function  */
void user_task(void *pvParameters)
{
    bme680_values_float_t values;
    TickType_t last_wakeup = xTaskGetTickCount();
    uint32_t duration = bme680_get_measurement_duration(sensor);
    while (1)
    {
        if (bme680_force_measurement (sensor))
        {
            vTaskDelay (duration);
            if (bme680_get_results_float (sensor, &values))
                printf("%.3f BME680 Sensor: %.2f °C, %.2f %%, %.2f hPa, %.2f Ohm\n",
                       (double)sdk_system_get_time()*1e-3,
                       values.temperature, values.humidity,
                       values.pressure, values.gas_resistance);
        }
        vTaskDelayUntil(&last_wakeup, 1000 / portTICK_PERIOD_MS);
    }
}