Arthur Coupe / LM75B

Files at this revision

API Documentation at this revision

Comitter:
arthur_2000
Date:
Fri Nov 06 17:07:37 2020 +0000
Parent:
1:6a70c9303bbe
Commit message:
.

Changed in this revision

LM75B.cpp Show annotated file Show diff for this revision Revisions of this file
LM75B.h Show annotated file Show diff for this revision Revisions of this file
--- a/LM75B.cpp	Fri Oct 26 21:40:51 2012 +0000
+++ b/LM75B.cpp	Fri Nov 06 17:07:37 2020 +0000
@@ -15,12 +15,12 @@
 
 }
 
-float LM75B::read()
+uint16_t LM75B::read()
 {
     char cmd[2];
     cmd[0] = LM75B_Temp;
    
     i2c.write( LM75B_ADDR, cmd, 1); // Send command string
     i2c.read( LM75B_ADDR, cmd, 2); // Send command string    
-    return (   float((cmd[0]<<8)|cmd[1]) / 256.0   );
+    return ((cmd[0]<<8)|cmd[1]);
 }
--- a/LM75B.h	Fri Oct 26 21:40:51 2012 +0000
+++ b/LM75B.h	Fri Nov 06 17:07:37 2020 +0000
@@ -53,7 +53,7 @@
   /*!
   Reads the temperature register of the LM75B and converts it to a useable value.
   */
-  float read();
+  uint16_t read();
   
 private: