-
Notifications
You must be signed in to change notification settings - Fork 0
/
PKG-INFO
166 lines (129 loc) · 5 KB
/
PKG-INFO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
Metadata-Version: 2.1
Name: piqmp6988
Version: 1.0.1
Summary: To use QMP6988 with pigpio.
Home-page: https://github.com/Langur/piqmp6988
Author: Akihisa ONODA
Author-email: [email protected]
License: MIT
Description: # Installing
Stable library from PyPi:
* Just run `pip install piqmp6988`
# PiQmp6988's Methods
## Constructor(config={})
'config' is dictionary type.
### 'address'
Configure I2C address of QMP6988.
* Address.LOW.value
* I2C address is 0x70
* Default
* Address.HIGH.value
* I2C address is 0x56
### 'filter'
Configure Infinite Impulse Response(IIR) Filter coefficient of QMP6988.
* Filter.COEFFECT_OFF.value
* Do not use IIR Filter
* Default
* Filter.COEFFECT_2.value
* IIR filter coefficient is 2
* Filter.COEFFECT_4.value
* IIR filter coefficient is 4
* Filter.COEFFECT_8.value
* IIR filter coefficient is 8
* Filter.COEFFECT_16.value
* IIR filter coefficient is 16
* Filter.COEFFECT_32.value
* IIR filter coefficient is 32
### 'mode'
Configure Power Mode of QMP6988.
* Powermode.SLEEP.value
* Power Mode is SLEEP
* Default
* Powermode.FORCE.value
* Power Mode is Force
* Powermode.NORMAL.value
* Power Mode is Normal
### 'pressure'
Configure average times for pressure measurement of QMP6988.
* Oversampling.SKIP.value
* Do not measure pressure
* Default
* Oversampling.X1.value
* Single Shot value
* Oversampling.X2.value
* Average 2 times for mesurment value
* Oversampling.X4.value
* Average 4 times for mesurment value
* Oversampling.X8.value
* Average 8 times for mesurment value
* Oversampling.X16.value
* Average 16 times for mesurment value
* Oversampling.X32.value
* Average 32 times for mesurment value
* Oversampling.X64.value
* Average 64 times for mesurment value
### 'temperature'
Configure average times for temperature measurement of QMP6988.
* Oversampling.SKIP.value
* Do not measure temperature
* Use 25.0 celsius value when 'pressure' measure
* Default
* Oversampling.X1.value
* Single Shot value
* Oversampling.X2.value
* Average 2 times for mesurment value
* Oversampling.X4.value
* Average 4 times for mesurment value
* Oversampling.X8.value
* Average 8 times for mesurment value
* Oversampling.X16.value
* Average 16 times for mesurment value
* Oversampling.X32.value
* Average 32 times for mesurment value
* Oversampling.X64.value
* Average 64 times for mesurment value
## read()
Read temperature and pressure.
Return value is dictionary type.
### 'temperature'
* OK
* Type: float
* Celsius temperature value [℃]
* NG
* Type: False
### 'pressure'
* OK
* Type: float
* Atmospheric pressure value [hPa]
* NG
* Type: False
# Sample
Run `sudo pigpiod` before running the sample.
## Indoor navigation (from QMP6988 Datasheet)
.. code-block:: shell
# -*- coding: utf-8 -*-
import piqmp6988 as QMP6988
import time
config = {
'temperature' : QMP6988.Oversampling.X4.value,
'pressure' : QMP6988.Oversampling.X32.value,
'filter' : QMP6988.Filter.COEFFECT_32.value,
'mode' : QMP6988.Powermode.NORMAL.value
}
obj = QMP6988.PiQmp6988(config)
try:
while True:
value = obj.read()
if (isinstance(value['temperature'], float)):
print("%8.2f" % round(valueb['temperature'], 2))
if (isinstance(valueb['pressure'], float)):
print("%8.2f" % round(valueb['pressure'], 2))
time.sleep(10)
except KeyboardInterrupt:
pass
Keywords: piqmp6988 qmp6988 env3hat pigpio temperature pressure sensor i2c
Platform: UNKNOWN
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Description-Content-Type: text/markdown