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.
Dependents: POF_force_angle_copy
Diff: HX711.h
- Revision:
- 0:716e1cbdac61
- Child:
- 1:a2666eae3d06
diff -r 000000000000 -r 716e1cbdac61 HX711.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/HX711.h Wed Nov 25 20:21:30 2015 +0000
@@ -0,0 +1,61 @@
+/*
+ * FILE: HX711.h
+ *
+ * VERSION: 0.1
+ * PURPOSE: HX711 weight library for Nucleo STM32
+ * AUTHOR: Bertrand Bouvier
+ * LICENSE: GPL v3 (http://www.gnu.org/licenses/gpl.html)
+ *
+ * DATASHEET: http://www.dfrobot.com/image/data/SEN0160/hx711_english.pdf
+ * URL:
+ *
+ * HISTORY:
+ * 24/05/2015 - Bertrand Bouvier - Original version
+ * see HX711.cpp
+ *
+ * SPECIAL THANKS:
+ * Inspiré du travail de Weihong Guan (@aguegu)
+ * https://github.com/aguegu/Arduino
+ * http://aguegu.net
+ *
+ * Inspiré du travail de bodge
+ * https://github.com/bogde/HX711
+ *
+ */
+
+#ifndef HX711_H
+#define HX711_H
+
+#include "mbed.h"
+
+
+class HX711
+{
+
+public:
+ HX711(PinName pinData, PinName pinSck,uint8_t gain = 128);
+ ~HX711();
+ int getValue(void);
+ int averageValue(uint8_t times);
+ void setOffset(int offset);
+ void setScale(float scale);
+ float getGram();
+ void setGain(uint8_t gain);
+ void powerDown();
+ void powerUp();
+ void tare(uint8_t times = 10);
+
+
+private:
+ PinName _pinData;
+ PinName _pinSck;
+ int _offset;
+ float _scale;
+ uint8_t _gain; //[128|32|64]
+
+
+};
+
+#endif
+
+
\ No newline at end of file