Arduino library to read the temperature from the Raspberry Pi Pico's internal temperature sensor.
You can install this library using the Arduino IDE's Library Manager. Search for "Raspberry Pi Pico CPU Temperature" and install the latest version.
#include <CPU.h> // Include the library to use the CPU temperature sensor
CPU cpu; // Create an instance of the CPU temperature sensor
void setup() {
Serial.begin(9600);
cpu.begin(); // Initialize the CPU temperature sensor
}
void loop() {
// Print the CPU temperature in Celsius
Serial.println("CPU temperature: " + String(cpu.getTemperature()) + " °C");
delay(1000);
}
This library is licensed under the MIT license. See LICENSE for more information.
Pull requests are welcome. Please commit your changes in the dev
branch using Conventional Commits.