Skip to main content

# 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)

# -*- 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

Metadata

Release files for piqmp6988 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for piqmp6988 1.0.1
File Size Uploaded
piqmp6988-1.0.1.tar.gz 6.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for piqmp6988 1.0.1
File Interpreter ABI Platform
piqmp6988-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 14.0 kB

Release files / piqmp6988-1.0.1.tar.gz

Download URL piqmp6988-1.0.1.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1a757fb1408f8c9da2a9299e05280d859777a216fd72685aeded938d1e5e024b
BLAKE2b-256 checksum
How to use checksums
352094ef3ab59cd1ba4b6b022ee5dcf775bc3a28b35dd3b3b1b3ff086d1d08ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.9

Release files / piqmp6988-1.0.1-py3-none-any.whl

Download URL piqmp6988-1.0.1-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f39e63223ce74e46ba9404a769f1be8529b749ce8d8a57eba3ef841fb5ea0194
BLAKE2b-256 checksum
How to use checksums
973ec863ce62190013fbdc84536296be500fb69ddde208ddedc220596b18ae31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.9

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page