Go to advanced search

by badfur
Mon Apr 01, 2013 10:38 am
Forum: Beginners
Topic: [Tutorial] Show RPI's Temperature with a command.
Replies: 71
Views: 603646

Re: [Tutorial] Show RPI's Temperature with a command.

Code: Select all

#!/bin/bash
cpuTemp0=$(cat /sys/class/thermal/thermal_zone0/temp)
cpuTemp1=$(($cpuTemp0/1000))
cpuTemp2=$(($cpuTemp0/100))
cpuTempM=$(($cpuTemp2 % $cpuTemp1))

echo CPU temp"="$cpuTemp1"."$cpuTempM"'C"
echo GPU $(/opt/vc/bin/vcgencmd measure_temp)

Go to advanced search