You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/HX711_ADC.h
+5-4Lines changed: 5 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -54,8 +54,8 @@ class HX711_ADC
54
54
voidsetGain(uint8_t gain = 128); //value must be 32, 64 or 128*
55
55
voidbegin(); //set pinMode, HX711 gain and power up the HX711
56
56
voidbegin(uint8_t gain); //set pinMode, HX711 selected gain and power up the HX711
57
-
intstart(unsignedint t); //start HX711 and do tare
58
-
intstart(unsignedint t, bool dotare); //start HX711, do tare if selected
57
+
voidstart(unsignedint t); //start HX711 and do tare
58
+
voidstart(unsignedint t, bool dotare); //start HX711, do tare if selected
59
59
intstartMultiple(unsignedint t); //start and do tare, multiple HX711 simultaniously
60
60
intstartMultiple(unsignedint t, bool dotare); //start and do tare if selected, multiple HX711 simultaniously
61
61
voidtare(); //zero the scale, wait for tare to finnish (blocking)
@@ -84,12 +84,13 @@ class HX711_ADC
84
84
boolgetSignalTimeoutFlag(); //returns 'true' if it takes longer time then 'SIGNAL_TIMEOUT' for the dout pin to go low after a new conversion is started
85
85
86
86
protected:
87
-
uint8_tconversion24bit(); //if conversion is ready: returns 24 bit data and starts the next conversion
87
+
voidconversion24bit(); //if conversion is ready: returns 24 bit data and starts the next conversion
88
88
longsmoothedData(); //returns the smoothed data value calculated from the dataset
89
89
uint8_t sckPin; //HX711 pd_sck pin
90
90
uint8_t doutPin; //HX711 dout pin
91
91
uint8_t GAIN; //HX711 GAIN
92
-
float calFactor = 1.0; //calibration factor, the raw data is divided with this number
92
+
float calFactor = 1.0; //calibration factor as given in function setCalFactor(float cal)
93
+
float calFactorRecip = 1.0; //reciprocal calibration factor (1/calFactor), the HX711 raw data is multiplied by this value
93
94
volatilelong dataSampleSet[DATA_SET + 1]; // dataset, make voltile if interrupt is used
0 commit comments