-
Notifications
You must be signed in to change notification settings - Fork 5
Chip Temperature
DD4WH edited this page Mar 18, 2020
·
13 revisions
xxx
analogReadResolution(16);
// for 10bit resolution
//temperature = -1.8626 * analogRead(70) + 434.5;
// for 16bit resolution
temperature = -0.0293 * analogRead(70) + 440.5;xxx
The Teensy 4 core has an inbuilt function:
extern float tempmonGetTemp(void);
void setup() {
while (!Serial);
}
void loop() {
Serial.print( tempmonGetTemp() );
Serial.println("°C");
delay(500);
}Note: Temperature conversion formula from degree Celsius to Fahrenheit is given by
F = (C * 9.0f / 5.0f) + 32.0f
Teensy is a PJRC trademark. Notes here are for reference and will typically refer to the ARM variants unless noted.