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
-**bool isConnected()** returns true if device address can be seen on I2C.
152
-
-**void reset()** reset internal variables.
171
+
-**bool begin()** initialize the library.
172
+
Returns false if deviceAddress cannot be seen on the I2C bus.
173
+
-**bool isConnected()** returns true if deviceAddress can be seen on I2C, false otherwise.
174
+
-**void reset()** resets the internal variables.
153
175
154
176
155
-
#### Timing
177
+
###Heating
156
178
157
-
-**bool isHeated()** returns true if 2 minutes have passed after startup (call of **begin()** ).
179
+
-**bool isHeated()** returns true if 2 minutes have passed after call of **begin()**.
158
180
Otherwise the device is not optimal ready.
159
-
According to the datasheet the preheating will improve the quality of the measurements.
160
-
-**uint32_t lastRead()** last time the device is read, timestamp is in milliseconds since start.
181
+
According to the datasheet, preheating will improve the quality of the measurements.
182
+
Note: if begin() is not called, isHeated() might be incorrect.
183
+
-**uint32_t lastRead()** returns the last time the device is read,
184
+
timestamp is in milliseconds since start.
161
185
Returns 0 if **readPPB()** or **readUGM3()** is not called yet.
162
186
This function allows to implement sort of asynchronous wait.
163
-
One must keep reads at least 1.5 seconds but preferred 3 seconds apart according to the datasheet.
187
+
One must keep reads / measurements at least 1.5 seconds but preferred 3 seconds
188
+
apart according to the datasheet.
164
189
165
190
166
-
####Administration
191
+
### Administration
167
192
168
193
-**bool setAddress(const uint8_t deviceAddress)** sets a new address for the sensor.
169
194
If function succeeds the address changes immediately and will be persistent over a reboot.
170
195
-**uint8_t getAddress()** returns the set address. Default the function will return 26 or 0x1A.
171
-
-**uint8_t getSensorVersion()** reads sensor version from device.
196
+
-**uint8_t getSensorVersion()** reads sensor version from the device.
172
197
If the version cannot be read the function will return 255.
173
-
(My test sensors all return version 117, version 118 is reported)
174
-
-**uint32_t getSensorDate()** (experimental) reads bytes from the sensor that seem to indicate the production date(?). This date is encoded in an uint32_t to minimize footprint as it is a debug function.
198
+
My test sensors all return version 117, version 118 is reported to exist too.
199
+
-**uint32_t getSensorDate()** (experimental) reads bytes from the sensor that seem
200
+
to indicate the production date(?).
201
+
This date is encoded in an uint32_t to minimize footprint as it is a debug function.
175
202
176
203
```cpp
177
204
uint32_t dd = sensor.getSensorDate();
178
205
Serial.println(dd, HEX); // prints YYYYMMDD e.g. 20210203
179
206
```
180
207
181
208
182
-
####I2C clock speed
209
+
### I2C clock speed
183
210
184
211
The library sets the clock speed to 25 KHz during operation
185
212
and resets it to 100 KHz after operation.
@@ -190,7 +217,7 @@ The following function can change the I2C reset speed to e.g. 200 or 400 KHz.
190
217
-**uint32_t getI2CResetSpeed()** returns the value set. Default is 100 KHz.
191
218
192
219
193
-
####setMode
220
+
### setMode
194
221
195
222
The default mode at startup of the sensor is PPB = parts per billion.
196
223
@@ -199,7 +226,7 @@ The default mode at startup of the sensor is PPB = parts per billion.
0 commit comments