Skip to main content

Python driver for the SparkFun SPX-17979 Qwiic Sound Trigger

Project description

spx17979-driver

Python driver for the SparkFun SPX-17979 Qwiic Sound Trigger.

PyPI PyPI - License PyPI - Downloads

Installation

The package is available on PyPI. Installation is can be done with your favourite package manager. For example:

pip install spx17979-driver

Usage

In order to initialise the device we need an open SMBus object. Depending on the machine that you are running on you may need to provide another bus number or path:

from spx17979 import SPX17979
from smbus2 import SMBus


with SMBus(1) as bus:
    device = SPX17979(bus=bus)

When the device has been triggered by a sound, the trigger property will be True. It can be reset by calling the reset() method. That is it!

A simple usage example:

from time import sleep

from spx17979 import SPX17979
from smbus2 import SMBus


with SMBus(1) as bus:
    device = SPX17979(bus=bus)
    device.reset()
    
    while True:
        if device.trigger:
            print("Triggered!")
            sleep(0.5)  # Prevent triggering twice on the same sound
            device.reset()
        sleep(0.001)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spx17979-driver-0.1.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

spx17979_driver-0.1.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file spx17979-driver-0.1.0.tar.gz.

File metadata

  • Download URL: spx17979-driver-0.1.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.12

File hashes

Hashes for spx17979-driver-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9abfd3afcb99fe0c28177e9182d483b90f8188949fd9e420b0a054c244cc8a84
MD5 1501540790e7189acde994b698829377
BLAKE2b-256 b367abe2295e787e08b532ca3895e8575b6a8aa52dda15aeae045ed8b14c7940

See more details on using hashes here.

File details

Details for the file spx17979_driver-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: spx17979_driver-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.12

File hashes

Hashes for spx17979_driver-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4fb53b6c4c696e25639507a9076176133c555cde943fb68196137ea527951cfa
MD5 6bf0f51ebf17a5ab4231ed94f8cc43ab
BLAKE2b-256 7aeb1e2f0ce743db6eba6899ccc194129b2bae2db964ae1130ca3564e41ec58e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page