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
+14-2Lines changed: 14 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -153,11 +153,19 @@ typedef enum
153
153
NAU7802_CHANNEL_2 = 1,
154
154
} NAU7802_Channels;
155
155
156
+
//Calibration state
157
+
typedefenum
158
+
{
159
+
NAU7802_CAL_SUCCESS = 0,
160
+
NAU7802_CAL_IN_PROGRESS = 1,
161
+
NAU7802_CAL_FAILURE = 2,
162
+
} NAU7802_Cal_Status;
163
+
156
164
classNAU7802
157
165
{
158
166
public:
159
167
NAU7802(); //Default constructor
160
-
boolbegin(TwoWire &wirePort = Wire); //Check communication and initialize sensor
168
+
boolbegin(TwoWire &wirePort = Wire, bool reset = true); //Check communication and initialize sensor
161
169
boolisConnected(); //Returns true if device acks at the I2C address
162
170
163
171
boolavailable(); //Returns true if Cycle Ready bit is set (conversion is complete)
@@ -179,7 +187,11 @@ class NAU7802
179
187
boolsetSampleRate(uint8_t rate); //Set the readings per second. 10, 20, 40, 80, and 320 samples per second is available
180
188
boolsetChannel(uint8_t channelNumber); //Select between 1 and 2
181
189
182
-
boolcalibrateAFE(); //Calibrate the analog from end of the NAU7802. Returns true if CAL_ERR bit is 0 (no error)
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
+
boolwaitForCalibrateAFE(uint32_t timeout_ms = 0); //Wait for asynchronous AFE calibration to complete with optional timeout.
0 commit comments