Added scaffolding for DS18B20

This commit is contained in:
2023-11-01 17:31:30 +00:00
parent 7d53186fc7
commit 8aeade9922
5 changed files with 25 additions and 1 deletions

View File

@@ -0,0 +1,3 @@
idf_component_register(SRCS "ds18b20.c"
INCLUDE_DIRS "."
REQUIRES driver)

View File

@@ -0,0 +1,15 @@
menu "DS18B20"
config DS18B20_ENABLED
bool "DS18B20 Enabled"
default y
config DS18B20_GPIO_PIN
int "GPIO Pin used for 1-Wire DS18B20"
default 10
depends on DS18B20_ENABLED
config DS18B20_PERIOD_POLL
int "Period to poll the DS18B20 in seconds"
default 8000
depends on DS18B20_ENABLED
endmenu

View File

@@ -0,0 +1,4 @@
int test() {
int i = 5;
return i;
}

View File

View File

@@ -116,7 +116,9 @@ void read_from_dht22() {
ten_minute_average.time.myt_month = timeinfo->tm_mon; ten_minute_average.time.myt_month = timeinfo->tm_mon;
ten_minute_average.time.myt_year = timeinfo->tm_year; ten_minute_average.time.myt_year = timeinfo->tm_year;
// TODO check this conversion just works // TODO: Consider rounding this number - although, .1 of a degree C
// no one is going to miss that. Probably the calculation require to
// do the rounding would affect the temperature that much anyways haha
ten_minute_average.temp = temperature_tmp; ten_minute_average.temp = temperature_tmp;
ten_minute_average.rh = relative_humidity_tmp; ten_minute_average.rh = relative_humidity_tmp;
ESP_LOGW(TAG, "ten_min_avg.temp %" PRIi16 ", .rh %" PRIu16, ten_minute_average.temp, ten_minute_average.rh); ESP_LOGW(TAG, "ten_min_avg.temp %" PRIi16 ", .rh %" PRIu16, ten_minute_average.temp, ten_minute_average.rh);