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/SparkFun_Qwiic_Scale_NAU7802_Arduino_Library.h
+11-11Lines changed: 11 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -164,35 +164,35 @@ typedef enum
164
164
classNAU7802
165
165
{
166
166
public:
167
-
NAU7802(); //Default constructor
167
+
NAU7802(); //Default constructor
168
168
boolbegin(TwoWire &wirePort = Wire, bool reset = true); //Check communication and initialize sensor
169
-
boolisConnected(); //Returns true if device acks at the I2C address
169
+
boolisConnected(); //Returns true if device acks at the I2C address
170
170
171
-
boolavailable(); //Returns true if Cycle Ready bit is set (conversion is complete)
171
+
boolavailable(); //Returns true if Cycle Ready bit is set (conversion is complete)
172
172
int32_tgetReading(); //Returns 24-bit reading. Assumes CR Cycle Ready bit (ADC conversion complete) has been checked by .available()
173
173
int32_tgetAverage(uint8_t samplesToTake); //Return the average of a given number of readings
174
174
175
175
voidcalculateZeroOffset(uint8_t averageAmount = 8); //Also called taring. Call this with nothing on the scale
176
-
voidsetZeroOffset(int32_t newZeroOffset); //Sets the internal variable. Useful for users who are loading values from NVM.
177
-
int32_tgetZeroOffset(); //Ask library for this value. Useful for storing value into NVM.
176
+
voidsetZeroOffset(int32_t newZeroOffset); //Sets the internal variable. Useful for users who are loading values from NVM.
177
+
int32_tgetZeroOffset(); //Ask library for this value. Useful for storing value into NVM.
178
178
179
179
voidcalculateCalibrationFactor(float weightOnScale, uint8_t averageAmount = 8); //Call this with the value of the thing on the scale. Sets the calibration factor based on the weight on scale and zero offset.
180
180
voidsetCalibrationFactor(float calFactor); //Pass a known calibration factor into library. Helpful if users is loading settings from NVM.
181
181
floatgetCalibrationFactor(); //Ask library for this value. Useful for storing value into NVM.
182
182
183
-
floatgetWeight(bool allowNegativeWeights = false); //Once you've set zero offset and cal factor, you can ask the library to do the calculations for you.
183
+
floatgetWeight(bool allowNegativeWeights = false, uint8_t samplesToTake = 8); //Once you've set zero offset and cal factor, you can ask the library to do the calculations for you.
184
184
185
185
boolsetGain(uint8_t gainValue); //Set the gain. x1, 2, 4, 8, 16, 32, 64, 128 are available
186
186
boolsetLDO(uint8_t ldoValue); //Set the onboard Low-Drop-Out voltage regulator to a given value. 2.4, 2.7, 3.0, 3.3, 3.6, 3.9, 4.2, 4.5V are avaialable
187
187
boolsetSampleRate(uint8_t rate); //Set the readings per second. 10, 20, 40, 80, and 320 samples per second is available
188
188
boolsetChannel(uint8_t channelNumber); //Select between 1 and 2
189
189
190
-
boolcalibrateAFE(); //Synchronous calibration of the analog front end of the NAU7802. Returns true if CAL_ERR bit is 0 (no error)
191
-
voidbeginCalibrateAFE(); //Begin asynchronous calibration of the analog front end of the NAU7802. Poll for completion with calAFEStatus() or wait with waitForCalibrateAFE().
190
+
boolcalibrateAFE(); //Synchronous calibration of the analog front end of the NAU7802. Returns true if CAL_ERR bit is 0 (no error)
191
+
voidbeginCalibrateAFE(); //Begin asynchronous calibration of the analog front end of the NAU7802. Poll for completion with calAFEStatus() or wait with waitForCalibrateAFE().
192
192
boolwaitForCalibrateAFE(uint32_t timeout_ms = 0); //Wait for asynchronous AFE calibration to complete with optional timeout.
0 commit comments