Page 1 of 1

code that worked on esp32 does not work on esp32 c3

Posted: Tue Jan 25, 2022 3:57 pm
by Alsor1962
code example:

import esp
import esp32

temp_f = round(esp32.raw_temperature(), 2)
temp_c = round(((esp32.raw_temperature()-32)/1.8), 2)
print('Temperature F:', temp_f,' F')
print('Temperature C:', temp_c, ' C')


what is the problem?

Re: code that worked on esp32 does not work on esp32 c3

Posted: Tue Jan 25, 2022 4:12 pm
by Roberthh
There is no temperature sensor in the ESP32 C3, and thus the method esp32.raw_temperature() does not exist.

Re: code that worked on esp32 does not work on esp32 c3

Posted: Wed Jan 26, 2022 3:23 am
by Alsor1962
Roberthh wrote:
Tue Jan 25, 2022 4:12 pm
There is no temperature sensor in the ESP32 C3, and thus the method esp32.raw_temperature() does not exist.
but the dadshit says that there is a temperature sensor.
https://www.espressif.com/sites/default ... eet_en.pdf

thank you for your responses
Alex

Re: code that worked on esp32 does not work on esp32 c3

Posted: Wed Jan 26, 2022 7:08 am
by Roberthh
If the data sheet mentions it, it should be physically present, but the API in the esp32 module is missing. And thus you cannot use it. Anyhow, it would tell you the temperature of the ESP32 chip, which is usually not of interest and hardly related to the outside temperature.