Skip to content

Commit

Permalink
Minor compability fix
Browse files Browse the repository at this point in the history
fix for samd/arm
  • Loading branch information
olkal committed Nov 19, 2017
1 parent d562655 commit eb66f7e
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion examples/Calibrate/Calibrate.ino
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <HX711_ADC.h>

//HX711 constructor (dout pin, sck pin)
HX711_ADC LoadCell(A0, A1);
HX711_ADC LoadCell(4, 5);

long t;

Expand Down
2 changes: 1 addition & 1 deletion examples/Read_1x_load_cell/Read_1x_load_cell.ino
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <HX711_ADC.h>

//HX711 constructor (dout pin, sck pin)
HX711_ADC LoadCell(A0, A1);
HX711_ADC LoadCell(4, 5);

long t;

Expand Down
4 changes: 2 additions & 2 deletions examples/Read_2x_load_cell/Read_2x_load_cell.ino
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#include <HX711_ADC.h>

//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;

Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/HX711_ADC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit eb66f7e

Please sign in to comment.