save some implementation
This commit is contained in:
@@ -20,16 +20,20 @@ void i2c_sensors_task(void *pvParameters)
|
||||
|
||||
bme680b_init();
|
||||
mpu9250_init();
|
||||
mcp23018_init();
|
||||
ina260_init();
|
||||
ccs811_init();
|
||||
|
||||
mcp3550_spi_init();
|
||||
configure_led();
|
||||
|
||||
int16_t accel[3], gyro[3], temp;
|
||||
float accel_f[3], gyro_f[3], temp_f;
|
||||
|
||||
uint16_t eCO2;
|
||||
uint16_t tvoc;
|
||||
uint8_t currentCCS;
|
||||
uint16_t rawData;
|
||||
|
||||
uint16_t volts;
|
||||
uint16_t current;
|
||||
uint16_t power;
|
||||
@@ -51,19 +55,23 @@ void i2c_sensors_task(void *pvParameters)
|
||||
else
|
||||
{
|
||||
data.barometric_pressure = data.barometric_pressure / 100;
|
||||
// ESP_LOGI(TAG, "dewpoint temperature:%.2f °C", data.dewpoint_temperature);
|
||||
ESP_LOGI(TAG_BME, "dewpoint temperature:%.2f °C", data.dewpoint_temperature);
|
||||
ESP_LOGI(TAG_BME, "air temperature: %.2f °C", data.air_temperature);
|
||||
ESP_LOGI(TAG_BME, "relative humidity: %.2f %%", data.relative_humidity);
|
||||
ESP_LOGI(TAG_BME, "barometric pressure: %.2f hPa", data.barometric_pressure);
|
||||
// ESP_LOGI(TAG, "gas resistance: %.2f kOhms", data.gas_resistance / 1000);
|
||||
// ESP_LOGI(TAG, "iaq score: %u (%s)", data.iaq_score, bme680_air_quality_to_string(data.iaq_score));
|
||||
ccs811_set_env_data(data.air_temperature, data.relative_humidity);
|
||||
ESP_LOGI(TAG_BME, "gas resistance: %.2f kOhms", data.gas_resistance / 1000);
|
||||
ESP_LOGI(TAG_BME, "iaq score: %u (%s)", data.iaq_score, bme680_air_quality_to_string(data.iaq_score));
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
bme680b_init();
|
||||
}
|
||||
|
||||
ccs811_get_data(&eCO2, &tvoc);
|
||||
ccs811_get_data(&eCO2, &tvoc, ¤tCCS, &rawData);
|
||||
ESP_LOGI(TAG_CCS, "eCO₂: %d ppm, TVOC: %d ppb", eCO2, tvoc);
|
||||
ESP_LOGI(TAG_CCS, "Current: %d μA, Raw voltage: %d V", currentCCS, rawData);
|
||||
|
||||
if (mpu9250_read_sensor_data(MPU9250_DEV_HANDLE, accel, gyro, &temp) == ESP_OK)
|
||||
{
|
||||
@@ -81,6 +89,15 @@ void i2c_sensors_task(void *pvParameters)
|
||||
ina260_readParams(&volts, ¤t, &power);
|
||||
ina260_printParams(volts, current, power);
|
||||
|
||||
float VREFVoltage = volts * 1.25 / 1000; //Mame vobec nieco na VREFE? Na scheme su len medzi sebou prepojene
|
||||
|
||||
mics_adc_data_t ADCData = mcp3550_read_all(5.0); // vref = 5.0V
|
||||
log_mics_adc_values(&ADCData);
|
||||
|
||||
ADCData = mcp3550_read_all(VREFVoltage);
|
||||
|
||||
log_mics_adc_values(&ADCData);
|
||||
|
||||
gpio_set_level(BLINK_GPIO, s_led_state);
|
||||
/* Toggle the LED state */
|
||||
s_led_state = !s_led_state;
|
||||
|
Reference in New Issue
Block a user