Niko Birolini
/
poids
capteur poids
main.cpp
- Committer:
- nikobirolini
- Date:
- 2020-12-07
- Revision:
- 0:80a26a10fe98
File content as of revision 0:80a26a10fe98:
/* 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); } }