Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 1:5a1ec06c8cc9, committed 2015-07-16
- Comitter:
- Volt72
- Date:
- Thu Jul 16 12:29:39 2015 +0000
- Parent:
- 0:aa9794dcf489
- Child:
- 2:5d57c2060e7b
- Commit message:
- Version 2.0 Ajout fonction de r?cup?ration des grammes
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 |
--- a/HX711.cpp Tue Jun 02 15:38:54 2015 +0000
+++ b/HX711.cpp Thu Jul 16 12:29:39 2015 +0000
@@ -60,8 +60,8 @@
_scale = scale;
}
-float HX711::getGram()
+int HX711::getGram()
{
- long val = (averageValue() - _offset);
- return (float) val / _scale;
+ long val = (getValue() - _offset);
+ return (int)((val/_scale)*1000);
}
\ No newline at end of file
--- a/HX711.h Tue Jun 02 15:38:54 2015 +0000
+++ b/HX711.h Thu Jul 16 12:29:39 2015 +0000
@@ -57,9 +57,9 @@
/** Fonction permettant de récupérer la mesure directement en grammes
*
* @param aucun
- * @returns float Grammes mesurés
+ * @returns int Grammes mesurés
*/
- float getGram();
+ int getGram();
private: // Déclaration des propriétés de l'objet
DigitalIn _pin_dout; // Broche de donnée