-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add library docs about low-level reader usage
- Loading branch information
1 parent
e678564
commit 3b1acea
Showing
3 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
PMSx003 4 samples on default format | ||
2021-07-29 15:57:01: PM1 1.0, PM2.5 11.0, PM10 12.0 μg/m3 | ||
2021-07-29 15:57:21: PM1 0.0, PM2.5 6.0, PM10 6.0 μg/m3 | ||
2021-07-29 15:57:41: PM1 0.0, PM2.5 1.0, PM10 2.0 μg/m3 | ||
2021-07-29 15:58:01: PM1 0.0, PM2.5 1.0, PM10 2.0 μg/m3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
""" | ||
Read PMSx003 sensor on /dev/ttyUSB0. | ||
Use low-level reader methods for more granular | ||
control of the sensor. | ||
""" | ||
|
||
from pms.core import SensorReader | ||
|
||
reader = SensorReader(sensor="PMSx003", port="/dev/ttyUSB0") | ||
|
||
print("\nPMSx003 4 samples on default format") | ||
|
||
reader.open() | ||
for _ in range(4): | ||
print(reader.read_one()) | ||
reader.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters