Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gschorcht committed Jan 6, 2018
1 parent d1fe434 commit f8c36c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,12 +305,14 @@ ccs811_set_mode (sensor, ccs811_mode_1s);
...
```

Last, the user task that uses the sensor has to be created.
Finally, a user task that uses the sensor has to be created.

```
xTaskCreate(user_task, "user_task", 256, NULL, 2, 0);
```

**Please note:** To avoid concurrency situations when driver functions are used to access the sensor, for example to read data, the user task must not be created until the sensor configuration is completed.

The user task can use different approaches to fetch new data. Either new data are fetched periodically or the interrupt signal *nINT* is used when new data are available or eCO2 value exceeds defined thresholds.

If new data are fetched **periodically** the implementation of the user task is quite simply and could look like following.
Expand Down Expand Up @@ -564,6 +566,8 @@ void user_init(void)
// start periodic measurement with one measurement per second
ccs811_set_mode (sensor, ccs811_mode_1s);
}
else
printf("Could not initialize CCS811 sensor\n");
}
```
Expand Down
2 changes: 2 additions & 0 deletions main/ccs811_example.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,5 +174,7 @@ void user_init(void)
// start periodic measurement with one measurement per second
ccs811_set_mode (sensor, ccs811_mode_1s);
}
else
printf("Could not initialize CCS811 sensor\n");
}

0 comments on commit f8c36c2

Please sign in to comment.