Last active
September 18, 2018 20:52
-
-
Save stritti/8b4880931111c08543fd572542d5d574 to your computer and use it in GitHub Desktop.
Read internal temperature of ESP32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Arduino.h> | |
#include "esp_system.h" | |
extern "C" { | |
uint8_t temprature_sens_read(); | |
} | |
void setup() { | |
Serial.begin(115200); | |
} | |
void loop() { | |
//get internal temp of ESP32 | |
uint8_t temp_farenheit= temprature_sens_read(); | |
//convert farenheit to celcius | |
double temp = ( temp_farenheit - 32 ) / 1.8; | |
System.print("internal temp [°C]: "); | |
System.println(temp); | |
delay(500); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment