https://github.com/ripred/cputemp
Arduino Library to calculate the processors internal temperature using nothing more than the ATmega processor itself! Absolutely no additional components or connections are needed!
https://github.com/ripred/cputemp
arduino arduino-library atmega embedded microchip temperature temperature-monitoring
Last synced: 10 months ago
JSON representation
Arduino Library to calculate the processors internal temperature using nothing more than the ATmega processor itself! Absolutely no additional components or connections are needed!
- Host: GitHub
- URL: https://github.com/ripred/cputemp
- Owner: ripred
- License: mit
- Created: 2022-05-14T14:56:48.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-02-01T04:06:04.000Z (over 1 year ago)
- Last Synced: 2025-02-01T05:18:35.601Z (over 1 year ago)
- Topics: arduino, arduino-library, atmega, embedded, microchip, temperature, temperature-monitoring
- Language: C++
- Homepage: https://github.com/ripred/CPUTemp
- Size: 26.4 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/marketplace/actions/arduino_ci)
[](https://github.com/ripred/CPUTemp/actions/workflows/arduino-lint.yml)

[](https://github.com/ripred/CPUTemp/releases)
[](https://github.com/ripred/CPUTemp/blob/master/LICENSE)
# CPU Temperature
### Measure the internal temperature of the processor.
Retrieve the temperature of the internal ATMega328 processor using nothing more than the internal registers!
Absolutely NO external parts or connections are necessary. All that is needed is the Atmel microcontroller itself. That's it.
Example use:
#
```cpp
#include
// We don't need a setup and a loop function so we just use a single main:
int main() {
Serial.begin(115200);
// Read the processor temperature:
double temp = temperature();
// Format it as a string to 2 decimal places:
char fstr[8];
dtostrf(temp, 6, 2, fstr);
// Display it:
Serial.print("temperature: ");
Serial.println(fstr);
return 0;
}
```
output:
#
```
temperature: 96.70
```