capteur poids

Dependencies:   HX711

Revision:
0:80a26a10fe98
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Dec 07 08:23:44 2020 +0000
@@ -0,0 +1,28 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2019 ARM Limited
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+#include "mbed.h"
+#include "HX711.h"
+
+ HX711 capt(D3,D2);
+int main()
+{
+    // Initialise the digital pin LED1 as an output
+    capt.setOffset(8441475);
+    long poids;
+    long scale = 10;
+    while (true) {
+        long a = capt.averageValue(100);
+        printf("value: %ld\r\n",a);
+        poids=(a-8472493);
+         printf("poids : %ld\r\n",poids);
+        //printf("value: %ld\r\n",capt.getValue());
+        printf("*********************\r\n");
+       
+        wait(2);
+    }
+   
+
+}