|
|
@ -1,8 +1,4 @@ |
|
|
|
//
|
|
|
|
//#define LOG_LOCAL_LEVEL ESP_LOG_DEBUG
|
|
|
|
// Created by MightyPork on 2017/11/17.
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define LOG_LOCAL_LEVEL ESP_LOG_DEBUG |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <esp_log.h> |
|
|
|
#include <esp_log.h> |
|
|
|
#include <time.h> |
|
|
|
#include <time.h> |
|
|
@ -14,7 +10,7 @@ |
|
|
|
#include "voc_sensor.h" |
|
|
|
#include "voc_sensor.h" |
|
|
|
#include "i2c_utils.h" |
|
|
|
#include "i2c_utils.h" |
|
|
|
|
|
|
|
|
|
|
|
static const char *TAG = "vocsensor"; |
|
|
|
static const char *TAG = "voc"; |
|
|
|
|
|
|
|
|
|
|
|
#define VOC_I2C_NUM I2C_NUM_0 |
|
|
|
#define VOC_I2C_NUM I2C_NUM_0 |
|
|
|
#define VOC_I2C_TO_MS 250 |
|
|
|
#define VOC_I2C_TO_MS 250 |
|
|
@ -135,6 +131,8 @@ static void new_data_callback( |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO do something with this
|
|
|
|
|
|
|
|
|
|
|
|
ESP_LOGI(TAG, "BSEC outputs: timestamp = %d", (int) (outputs->output[0].time_stamp / INT64_C(1000000))); |
|
|
|
ESP_LOGI(TAG, "BSEC outputs: timestamp = %d", (int) (outputs->output[0].time_stamp / INT64_C(1000000))); |
|
|
|
for (uint8_t i = 0; i < outputs->nOutputs; i++) { |
|
|
|
for (uint8_t i = 0; i < outputs->nOutputs; i++) { |
|
|
|
const bsecData output = outputs->output[i]; |
|
|
|
const bsecData output = outputs->output[i]; |
|
|
@ -152,22 +150,22 @@ static void new_data_callback( |
|
|
|
ESP_LOGI(TAG, "\tBREATH_VOC_EQUIVALENT = %f, accuracy %d", output.signal, (int) output.accuracy); |
|
|
|
ESP_LOGI(TAG, "\tBREATH_VOC_EQUIVALENT = %f, accuracy %d", output.signal, (int) output.accuracy); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case BSEC_OUTPUT_RAW_TEMPERATURE: |
|
|
|
case BSEC_OUTPUT_RAW_TEMPERATURE: |
|
|
|
ESP_LOGI(TAG, "\tRAW_TEMPERATURE = %f, accuracy %d", output.signal, (int) output.accuracy); |
|
|
|
ESP_LOGI(TAG, "\tRAW_TEMPERATURE = %f", output.signal); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case BSEC_OUTPUT_RAW_PRESSURE: |
|
|
|
case BSEC_OUTPUT_RAW_PRESSURE: |
|
|
|
ESP_LOGI(TAG, "\tRAW_PRESSURE = %f, accuracy %d", output.signal, (int) output.accuracy); |
|
|
|
ESP_LOGI(TAG, "\tRAW_PRESSURE = %f", output.signal); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case BSEC_OUTPUT_RAW_HUMIDITY: |
|
|
|
case BSEC_OUTPUT_RAW_HUMIDITY: |
|
|
|
ESP_LOGI(TAG, "\tRAW_HUMIDITY = %f, accuracy %d", output.signal, (int) output.accuracy); |
|
|
|
ESP_LOGI(TAG, "\tRAW_HUMIDITY = %f", output.signal); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case BSEC_OUTPUT_RAW_GAS: |
|
|
|
case BSEC_OUTPUT_RAW_GAS: |
|
|
|
ESP_LOGI(TAG, "\tRAW_GAS = %f, accuracy %d", output.signal, (int) output.accuracy); |
|
|
|
ESP_LOGI(TAG, "\tRAW_GAS = %f", output.signal); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case BSEC_OUTPUT_SENSOR_HEAT_COMPENSATED_TEMPERATURE: |
|
|
|
case BSEC_OUTPUT_SENSOR_HEAT_COMPENSATED_TEMPERATURE: |
|
|
|
ESP_LOGI(TAG, "\tSENSOR_HEAT_COMPENSATED_TEMPERATURE = %f, accuracy %d", output.signal, (int) output.accuracy); |
|
|
|
ESP_LOGI(TAG, "\tSENSOR_HEAT_COMPENSATED_TEMPERATURE = %f", output.signal); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case BSEC_OUTPUT_SENSOR_HEAT_COMPENSATED_HUMIDITY: |
|
|
|
case BSEC_OUTPUT_SENSOR_HEAT_COMPENSATED_HUMIDITY: |
|
|
|
ESP_LOGI(TAG, "\tSENSOR_HEAT_COMPENSATED_HUMIDITY = %f, accuracy %d", output.signal, (int) output.accuracy); |
|
|
|
ESP_LOGI(TAG, "\tSENSOR_HEAT_COMPENSATED_HUMIDITY = %f", output.signal); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case BSEC_OUTPUT_STABILIZATION_STATUS: |
|
|
|
case BSEC_OUTPUT_STABILIZATION_STATUS: |
|
|
|
ESP_LOGI(TAG, "\tSTABILIZATION_STATUS status = %d", (int) output.signal); |
|
|
|
ESP_LOGI(TAG, "\tSTABILIZATION_STATUS status = %d", (int) output.signal); |
|
|
|