Library for HX711 device. 24-Bit Analog-to-Digital Converter (ADC) for Weigh Scales

Dependents:   EXPO_ANDA EXPO_ANDA_Copilotoco

Files at this revision

API Documentation at this revision

Comitter:
mcm
Date:
Wed Sep 13 09:11:22 2017 +0000
Parent:
3:d246aa415f3a
Commit message:
Adapt the scale was fixed, myFactor now works as expected, some comments were improved.

Changed in this revision

HX711.cpp Show annotated file Show diff for this revision Revisions of this file
HX711.h Show annotated file Show diff for this revision Revisions of this file
diff -r d246aa415f3a -r d7a5cd03ed09 HX711.cpp
--- a/HX711.cpp	Tue Sep 12 15:33:33 2017 +0000
+++ b/HX711.cpp	Wed Sep 13 09:11:22 2017 +0000
@@ -423,7 +423,8 @@
  *
  * @author      Manuel Caballero
  * @date        12/September/2017
- * @version     12/September/2017   The ORIGIN
+ * @version     13/September/2017   Adapt the scale was fixed, myFactor now works as expected.
+ *              12/September/2017   The ORIGIN
  * @pre         NaN.
  * @warning     NaN.
  */
@@ -433,7 +434,7 @@
     float m, w_zs;
     float c_zs, w_fs, c_fs, w_t;
     float c = 0;
-    float myFactor   =   0;
+    float myFactor   =   1.0;
 
     Vector_mass_t w;
 
@@ -442,7 +443,7 @@
     switch ( myScaleCalibratedMass ) {
         default:
         case HX711_SCALE_kg:
-            myFactor     =   1.0;
+            // myFactor     =   1.0;
             break;
 
         case HX711_SCALE_g:
diff -r d246aa415f3a -r d7a5cd03ed09 HX711.h
--- a/HX711.h	Tue Sep 12 15:33:33 2017 +0000
+++ b/HX711.h	Wed Sep 13 09:11:22 2017 +0000
@@ -78,7 +78,7 @@
     // CALIBRATION time end!
 
 
-    // REMOVE THE MASS ON THE LOAD CELL ( JUST LED2 ON ). Read the device without any mass to calculate the tare weight for 5 seconds
+    // [ OPTIONAL ] REMOVE THE MASS ON THE LOAD CELL ( JUST LED2 ON ). Read the device without any mass to calculate the tare weight for 5 seconds
     myled1   =   0;
     myled2   =   1;
     wait(3);