FYI - temp_sensor example from v5.2.1 doesn't compile

RoatanBill
Posts: 3
Joined: Tue Jan 30, 2024 2:55 pm

FYI - temp_sensor example from v5.2.1 doesn't compile

Postby RoatanBill » Mon Mar 11, 2024 12:50 am

/home/bill/espSketches/temp_sensor/main/temp_sensor_main.c: In function 'app_main':
/home/bill/esp/v5.2.1/esp-idf/components/driver/temperature_sensor/include/driver/temperature_sensor.h:42:20: error: 'TEMPERATURE_SENSOR_CLK_SRC_DEFAULT' undeclared (first use in this function); did you mean 'TEMPERATURE_SENSOR_CONFIG_DEFAULT'?
42 | .clk_src = TEMPERATURE_SENSOR_CLK_SRC_DEFAULT, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/bill/espSketches/temp_sensor/main/temp_sensor_main.c:18:54: note: in expansion of macro 'TEMPERATURE_SENSOR_CONFIG_DEFAULT'
18 | temperature_sensor_config_t temp_sensor_config = TEMPERATURE_SENSOR_CONFIG_DEFAULT(10, 50);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/bill/esp/v5.2.1/esp-idf/components/driver/temperature_sensor/include/driver/temperature_sensor.h:42:20: note: each undeclared identifier is reported only once for each function it appears in
42 | .clk_src = TEMPERATURE_SENSOR_CLK_SRC_DEFAULT, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/bill/espSketches/temp_sensor/main/temp_sensor_main.c:18:54: note: in expansion of macro 'TEMPERATURE_SENSOR_CONFIG_DEFAULT'
18 | temperature_sensor_config_t temp_sensor_config = TEMPERATURE_SENSOR_CONFIG_DEFAULT(10, 50);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

MicroController
Posts: 1735
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: FYI - temp_sensor example from v5.2.1 doesn't compile

Postby MicroController » Mon Mar 11, 2024 5:33 pm

The ESP32-S2/C3/S3/C2 has a built-in temperature sensor.
Which SoC/IDF_TARGET are you building for?

Who is online

Users browsing this forum: Bing [Bot] and 70 guests