Skip to content

Instantly share code, notes, and snippets.

@mhou1981
Created July 1, 2018 04:29
Show Gist options
  • Save mhou1981/82ef2232ef01e3273e126d6dce1b850c to your computer and use it in GitHub Desktop.
Save mhou1981/82ef2232ef01e3273e126d6dce1b850c to your computer and use it in GitHub Desktop.
PI3B Get temperature
#!/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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment