An application for school

Files at this revision

API Documentation at this revision

Comitter:
deboerengamer
Date:
Thu Nov 05 13:35:50 2020 +0000
Parent:
1:6a70c9303bbe
Commit message:
Made a repository

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	Thu Nov 05 13:35:50 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 (   uint16_t((cmd[0]<<8)|cmd[1])   );
 }
--- a/LM75B.h	Fri Oct 26 21:40:51 2012 +0000
+++ b/LM75B.h	Thu Nov 05 13:35:50 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: