Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
Replace iaq_init with iaq_init_continuous
Browse files Browse the repository at this point in the history
  • Loading branch information
abrauchli committed Mar 21, 2018
1 parent ff5a75c commit b4f49a6
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions sgpc3/sgpc3_example_usage.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ int main(void) {
* Do not run measure_signals between IAQ measurements
* (iaq, tVOC) without saving the baseline before the call and
* restoring it after with sgp_get_iaq_baseline / sgp_set_iaq_baseline.
* If a recent baseline is not available, reset it using sgp_iaq_init
* prior to running IAQ measurements. */
* If a recent baseline is not available, reset it using
* sgp_iaq_init_continuous prior to running IAQ measurements. */
err = sgp_measure_signals_blocking_read(&scaled_ethanol_signal);

if (err == STATUS_OK) {
Expand All @@ -76,14 +76,17 @@ int main(void) {
/* Consider the two cases (A) and (B):
* (A) If no baseline is available or the most recent baseline is more than
* one week old, it must discarded. A new baseline is found with
* sgp_iaq_init() */
err = sgp_iaq_init();
/* (B) If a recent baseline is available, set it after sgp_iaq_init() for
* faster start-up */
* sgp_iaq_init_continuous() */
err = sgp_iaq_init_continuous();
/* (B) If a recent baseline is available, set it after
* sgp_iaq_init_continuous() for faster start-up */
/* IMPLEMENT: retrieve iaq_baseline from presistent storage;
* err = sgp_set_iaq_baseline(iaq_baseline);
*/

/* IMPLEMENT: sleep for the desired accelerated warm-up duration */
/* sleep(64); */

/* Run periodic IAQ measurements at defined intervals */
while (1) {
err = sgp_measure_iaq_blocking_read(&tvoc_ppb);
Expand Down

0 comments on commit b4f49a6

Please sign in to comment.