mirror of
https://github.com/0xFEEDC0DE64/arduino-esp32.git
synced 2025-06-30 12:30:59 +02:00
Add api to get CPU temperature
Fixes: https://github.com/espressif/arduino-esp32/issues/563 Fixes: https://github.com/espressif/arduino-esp32/issues/625 Source: https://github.com/pcbreflux/espressif/blob/master/esp32/arduino/sketchb ook/ESP32_int_temp_sensor/ESP32_int_temp_sensor.ino
This commit is contained in:
@ -23,6 +23,15 @@
|
||||
#include "esp_log.h"
|
||||
#include <sys/time.h>
|
||||
|
||||
//Undocumented!!! Get chip temperature in Farenheit
|
||||
//Source: https://github.com/pcbreflux/espressif/blob/master/esp32/arduino/sketchbook/ESP32_int_temp_sensor/ESP32_int_temp_sensor.ino
|
||||
uint8_t temprature_sens_read();
|
||||
|
||||
float temperatureRead()
|
||||
{
|
||||
return (temprature_sens_read() - 32) / 1.8;
|
||||
}
|
||||
|
||||
void yield()
|
||||
{
|
||||
vPortYield();
|
||||
|
@ -61,6 +61,9 @@ void yield(void);
|
||||
#include "esp32-hal-bt.h"
|
||||
#include "esp_system.h"
|
||||
|
||||
//returns chip temperature in Celsius
|
||||
float temperatureRead();
|
||||
|
||||
unsigned long micros();
|
||||
unsigned long millis();
|
||||
void delay(uint32_t);
|
||||
|
Reference in New Issue
Block a user