check raspberry pi cpu temperature code example
Example 1: how to get the temp of cpu in linux terminal raspberry pi
cpu=$(</sys/class/thermal/thermal_zone0/temp)
echo "$((cpu/1000)) c"
Example 2: rasp pi cmd temperature
vcgencmd measure_temp
cpu=$(</sys/class/thermal/thermal_zone0/temp)
echo "$((cpu/1000)) c"
vcgencmd measure_temp