Line 57... |
Line 57... |
57 |
MSB=i2c_read(1); |
57 |
MSB=i2c_read(1); |
58 |
LSB=i2c_read(1); |
58 |
LSB=i2c_read(1); |
59 |
Check=i2c_read(0); |
59 |
Check=i2c_read(0); |
60 |
i2c_stop(); |
60 |
i2c_stop(); |
61 |
|
61 |
|
62 |
LSB = LSB >> 2; // trow out status bits |
62 |
LSB = LSB & 0xFC ; // trow out status bits |
63 |
|
63 |
|
64 |
data = (((unsigned int16) MSB << 8) + (LSB << 4)); |
64 |
data = make16(MSB,LSB); |
65 |
return(-46.85 + 175.72*((float)data/0xFFFF)); |
65 |
return(-46.85 + 175.72*((float)data/0xFFFF)); |
66 |
} |
66 |
} |
67 |
|
67 |
|
68 |
float SHT25_get_hum() |
68 |
float SHT25_get_hum() |
69 |
{ |
69 |
{ |
Line 81... |
Line 81... |
81 |
MSB=i2c_read(1); |
81 |
MSB=i2c_read(1); |
82 |
LSB=i2c_read(1); |
82 |
LSB=i2c_read(1); |
83 |
Check=i2c_read(0); |
83 |
Check=i2c_read(0); |
84 |
i2c_stop(); |
84 |
i2c_stop(); |
85 |
|
85 |
|
86 |
LSB = LSB >> 2; // trow out status bits |
86 |
LSB = LSB & 0xFC ; // trow out status bits |
87 |
|
87 |
|
88 |
data = (((unsigned int16) MSB << 8) + (LSB << 4) ); |
88 |
data = make16(MSB,LSB); |
89 |
return( -6.0 + 125.0*((float)data/0xFFFF)); |
89 |
return( -6.0 + 125.0*((float)data/0xFFFF)); |
90 |
} |
90 |
} |
91 |
|
91 |
|