For a project I am working on I needed a really quick way of reading the Raspberry Pi’s CPU temperature, most of the solutions I found ran the command line
… via Python’s subprocess function and parsed the result.
This just wasn’t quick enough for my project as I needed something which would gather lots of data, not just the cpu temperature every second, so I pulled together my own module and class which reads the data directly from /sys/class/thermal/thermal_zone0/temp.
Each Friday is PiDay here at Adafruit! Be sure to check out our posts, tutorials and new Raspberry Pi related products. Adafruit has the largest and best selection of Raspberry Pi accessories and all the code & tutorials to get you up and running in no time!