Sandbird

temp for raspberry pi

Dec 15th, 2016
792
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.33 KB | None | 0 0
  1. #!/bin/bash
  2. cpuTemp0=$(cat /sys/class/thermal/thermal_zone0/temp)
  3. cpuTemp1=$(($cpuTemp0/1000))
  4. cpuTemp2=$(($cpuTemp0/100))
  5. cpuTempM=$(($cpuTemp2 % $cpuTemp1))
  6.  
  7. gpuTemp0=$(/opt/vc/bin/vcgencmd measure_temp)
  8. gpuTemp0=${gpuTemp0//\'/ }
  9. gpuTemp0=${gpuTemp0//temp=/}
  10.  
  11. echo CPU Temp: $cpuTemp1"."$cpuTempM" C"
  12. echo GPU Temp: $gpuTemp0
Add Comment
Please, Sign In to add comment