Vladimir N. Shilov 1 жил өмнө
parent
commit
2b268dd491
1 өөрчлөгдсөн 2 нэмэгдсэн , 1 устгасан
  1. 2 1
      lib/htu21.c

+ 2 - 1
lib/htu21.c

@@ -21,7 +21,8 @@ htu_err_t htu_GetTemperature(int16_t * temperature) {
   I2C_WriteBytes(addr, 1, buf);
   if (i2cs == 0) {
     Delay(90);
-    i2c_rd_reg(addr, buf);
+    //i2c_rd_reg(addr, buf);
+    I2C_ReadBytes(addr, 3, buf);
 //    if(buf[2] == CalcSht21Crc(buf,2)) {
       val = buf[0];
       val <<= 8;