Created
June 26, 2018 16:55
-
-
Save wgx/34d6a9ee3c24998e8fd41f0787bdf4dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
lsb=$(i2cget -y -f 0 0x34 0x5f) | |
msb=$(i2cget -y -f 0 0x34 0x5e) | |
bin=$(( $(($msb << 4)) | $(($lsb & 0x0F)))) | |
cel=`echo $bin | awk '{printf("%.0f", ($1/10) - 144.7)}'` | |
fah=`echo $cel | awk '{printf("%.0f", ($1 * 1.8) + 32)}'` | |
echo "CHIP Temp: $cel°C $fah°F" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment