From eb66f7ec3013041be453ec6e956570636c181651 Mon Sep 17 00:00:00 2001 From: olkal Date: Sun, 19 Nov 2017 17:02:13 +0100 Subject: [PATCH] Minor compability fix fix for samd/arm --- README.md | 2 ++ examples/Calibrate/Calibrate.ino | 2 +- examples/Read_1x_load_cell/Read_1x_load_cell.ino | 2 +- examples/Read_2x_load_cell/Read_2x_load_cell.ino | 4 ++-- library.properties | 2 +- src/HX711_ADC.cpp | 2 -- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index f0541e8..cb5b3ea 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,8 @@ ADC noise is worst on the 80SPS rate. Unless very quick settling time is require Start up and tare: from start-up/reset, the tare function seems to be more accurate if called after a "pre-warm-up" period running conversions continuously for a few seconds. See example files. +Measuring units: Adjust the scaling factor with the function setCalFactor(float) in setup, so that the "readable" output matches your preferred unit. + Hardware and ADC noise: Wires between HX711 and load cell should be twisted and kept as short as possible. Most available HX711 modules seems to follow the reference design, but be aware that some modules are poorly designed with under-sized capacitors, and noisy readings. diff --git a/examples/Calibrate/Calibrate.ino b/examples/Calibrate/Calibrate.ino index 32608bd..622f2bd 100644 --- a/examples/Calibrate/Calibrate.ino +++ b/examples/Calibrate/Calibrate.ino @@ -22,7 +22,7 @@ #include //HX711 constructor (dout pin, sck pin) -HX711_ADC LoadCell(A0, A1); +HX711_ADC LoadCell(4, 5); long t; diff --git a/examples/Read_1x_load_cell/Read_1x_load_cell.ino b/examples/Read_1x_load_cell/Read_1x_load_cell.ino index 9f5d1ef..e0b9dda 100644 --- a/examples/Read_1x_load_cell/Read_1x_load_cell.ino +++ b/examples/Read_1x_load_cell/Read_1x_load_cell.ino @@ -11,7 +11,7 @@ #include //HX711 constructor (dout pin, sck pin) -HX711_ADC LoadCell(A0, A1); +HX711_ADC LoadCell(4, 5); long t; diff --git a/examples/Read_2x_load_cell/Read_2x_load_cell.ino b/examples/Read_2x_load_cell/Read_2x_load_cell.ino index 2fce4c1..160c32d 100644 --- a/examples/Read_2x_load_cell/Read_2x_load_cell.ino +++ b/examples/Read_2x_load_cell/Read_2x_load_cell.ino @@ -11,8 +11,8 @@ #include //HX711 constructor (dout pin, sck pin) -HX711_ADC LoadCell_1(A2, A3); //HX711 1 -HX711_ADC LoadCell_2(A0, A1); //HX711 2 +HX711_ADC LoadCell_1(4, 5); //HX711 1 +HX711_ADC LoadCell_2(6, 7); //HX711 2 long t; diff --git a/library.properties b/library.properties index 684b9ca..d63c9e7 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=HX711_ADC -version=1.0.0 +version=1.0.1 author=Olav Kallhovd maintainer=Olav Kallhovd sentence=Arduino library for the HX711 24-bit ADC for weight scales diff --git a/src/HX711_ADC.cpp b/src/HX711_ADC.cpp index 9b05580..de1c918 100644 --- a/src/HX711_ADC.cpp +++ b/src/HX711_ADC.cpp @@ -143,13 +143,11 @@ long HX711_ADC::smoothedData() long data = 0; long L = 0xFFFFFF; long H = 0x00; - cli(); for (uint8_t r = 0; r < DATA_SET; r++) { if (L > dataSampleSet[r]) L = dataSampleSet[r]; // find lowest value if (H < dataSampleSet[r]) H = dataSampleSet[r]; // find highest value data += dataSampleSet[r]; } - sei(); if(IGN_LOW_SAMPLE) data -= L; //remove lowest value if(IGN_HIGH_SAMPLE) data -= H; //remove highest value return data;