Skip to content

Instantly share code, notes, and snippets.

@Idorobots
Created July 15, 2014 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Idorobots/668e7c43bc1d8a2776a6 to your computer and use it in GitHub Desktop.
Save Idorobots/668e7c43bc1d8a2776a6 to your computer and use it in GitHub Desktop.
Parallella temp script
#!/bin/bash
raw=`cat /sys/bus/iio/devices/iio:device0/in_temp0_raw`
offset=`cat /sys/bus/iio/devices/iio:device0/in_temp0_offset`
scale=`cat /sys/bus/iio/devices/iio:device0/in_temp0_scale`
c_temp=`echo "scale=1;(($raw + $offset) * $scale) / 1000" | bc`
f_temp=`echo "scale=1;(($c_temp * 9) / 5) + 32" | bc`
echo
echo "Zynq Temp: $c_temp C / $f_temp F"
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment