[riot-notifications] [RIOT-OS/RIOT] drivers/hx711: driver and SAUL adaption for the HX711 sensor (#11416)

Philipp notifications at github.com
Tue Apr 23 16:59:53 CEST 2019


Citrullin commented on this pull request.



> + * @}
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "saul.h"
+#include "hx711.h"
+#include "hx711_params.h"
+
+static int read_weight(const void *dev, phydat_t *res)
+{
+    (void)dev;
+    uint32_t result = hx711_get_units(HX711_PARAM_AVG_TIMES);
+    res->val[0] = (int16_t) result;
+    res->unit = UNIT_G;

If the offset and scale it calibrated, yes.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11416#discussion_r277724117
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190423/28bff362/attachment.html>


More information about the notifications mailing list