|
@ -1,6 +1,6 @@ |
|
|
#!/bin/bash |
|
|
#!/bin/bash |
|
|
|
|
|
|
|
|
response=`i2cget -y 1 0x18 0x05 w` |
|
|
response=`/usr/sbin/i2cget -y 1 0x18 0x05 w` |
|
|
upper_byte=$(($response & 0x00FF)) |
|
|
upper_byte=$(($response & 0x00FF)) |
|
|
lower_byte=$(($response & 0xFF00)) |
|
|
lower_byte=$(($response & 0xFF00)) |
|
|
let "sign=0" |
|
|
let "sign=0" |
|
@ -13,5 +13,4 @@ else |
|
|
upper_byte=$((upper_byte & 0x0F)) |
|
|
upper_byte=$((upper_byte & 0x0F)) |
|
|
let "temperature = ($upper_byte*100 * 16 + $lower_byte*100 / 4096)" |
|
|
let "temperature = ($upper_byte*100 * 16 + $lower_byte*100 / 4096)" |
|
|
fi |
|
|
fi |
|
|
# printf %.2f "$(($temperature))e-2" |
|
|
printf %.2f "$(($temperature))e-2" |
|
|
echo $temperature > toto; |
|
|
|
|
|