Some comments and faster measurements

This commit is contained in:
2025-12-24 13:36:59 +01:00
parent 26c8f37253
commit 2b54594041

View File

@@ -7,17 +7,11 @@
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/event_groups.h"
#include "esp_system.h"
#include "esp_wifi.h"
#include "esp_event.h"
#include "esp_log.h"
#include "nvs_flash.h"
#include "lwip/err.h"
#include "lwip/sys.h"
#include <math.h>
#include "esp_adc/adc_continuous.h"
#include "esp_adc/adc_cali.h"
#include "esp_adc/adc_oneshot.h"
#include "esp_adc/adc_cali.h"
@@ -27,7 +21,7 @@
/* ===================== CONSTS ===================== */
#define SERVER_URL "http://192.168.178.157:8080/data"
#define RMS_WINDOW_MS 200
#define RMS_WINDOW_MS 50
#define CHANNEL ADC_CHANNEL_6
// TODO: Determine this
@@ -206,6 +200,7 @@ static float read_voltage_mv(void)
}
ESP_LOGI(TAG, "Raw measurement from sensor to calibrated value: %d -> %d", raw, mv);
// return (float)raw;
return (mv - CALIBRATION_FACTOR) / CALIBRATION_FACTOR;
}