diff options
author | Gergő J. Miklós | 2020-11-22 04:04:03 +0100 |
---|---|---|
committer | Gergő J. Miklós | 2020-11-22 04:04:03 +0100 |
commit | ea1f6adc8e47e2408fda07bbec595daeb1d3f402 (patch) | |
tree | d5e22c2993b336caccce38f6c04b45647c28b948 /src/lm75.c | |
parent | 47bda328c70858c3b61cddf8e1398ce7ab0ff700 (diff) | |
download | i2sensors-master.tar.gz i2sensors-master.zip |
Diffstat (limited to 'src/lm75.c')
-rw-r--r-- | src/lm75.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -59,7 +59,8 @@ static float calc_temp(float offset){ // Calculate temperature uint16 rawtemp = 0; //# Signed by default float temp; - buf[0] = 0x00; //# Measurement in the REG[0] + buf[0] = 0x00; + buf[1] = 0x00; //# Measurement in the REG[0] xchg_data(buf,1,0,2); //# Write: 1byte addr, Read: 2byte data, Wait:0, [buf] = 32 byte rawtemp = (buf[0]*256 + buf[1]) >> 5; //# /x*256 == x << 8/ (>> 5): Temp is 11bit data register |