Skip to main content

Introduction

Discord Build Status Code Style: Black

Provides access to onboard sensors and battet

Dependencies

This driver depends on:

Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle or individual libraries can be installed using circup.

Installing to a Connected CircuitPython Device with Circup

Make sure that you have circup installed in your Python environment. Install it with the following command if necessary:

pip3 install circup

With circup installed and your CircuitPython device connected use the following command to install:

circup install seeed_xiao_nrf52840

Or the following command to update an existing version:

circup update

Usage Example

import array
import time

import audiocore
import audiopwmio
import board

from seeed_xiao_nrf52840 import IMU, Mic, Battery

with Battery() as bat:
    print(f"Charge_status: {bat.charge_status}")
    print(f"Voltage: {bat.voltage}")
    print(f"Charge_current high?: {bat.charge_current}")
    print("Setting charge current to high")
    bat.charge_current = bat.CHARGE_100MA
    print(f"Charge_current high?: {bat.charge_current}")

with IMU() as imu:
    for i in range(5):
        print("Acceleration:", imu.acceleration)
        time.sleep(1)

with Mic() as mic:
    for i in range(5):
        print(f"Start speaking in: {5-i}")
        time.sleep(1)
    b = array.array("H")
    for i in range(8000):
        b.append(0)
    print("SPEAK!!!")
    mic.record(b, len(b))
    print(b)
    for i in range(5):
        print(f"Replaying in: {5-i}")
        time.sleep(1)
    with audiopwmio.PWMAudioOut(board.D0) as aud:
        print("PWM setup")
        sample = audiocore.RawSample(b, sample_rate=8000)
        print("sample ready")
        aud.play(sample,loop=True)
        print("playing")
        time.sleep(5)
        aud.stop()

Documentation

API documentation for this library can be found on Read the Docs.

For information on building library documentation, please check out this guide.

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

Metadata

Release files for circuitpython-seeed-xiao-nrf52840 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 circuitpython-seeed-xiao-nrf52840 1.0.1
File Size Uploaded Provenance Actions
circuitpython-seeed-xiao-nrf52840-1.0.1.tar.gz 29.4 kB Without provenance Details for circuitpython-seeed-xiao-nrf52840-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for circuitpython-seeed-xiao-nrf52840 1.0.1
File Interpreter ABI Platform Actions
circuitpython_seeed_xiao_nrf52840-1.0.1-py3-none-any.whl Python 3 none any Details for circuitpython_seeed_xiao_nrf52840-1.0.1-py3-none-any.whl

Total release size: 35.8 kB

Release files / circuitpython-seeed-xiao-nrf52840-1.0.1.tar.gz

Download URL circuitpython-seeed-xiao-nrf52840-1.0.1.tar.gz
Size 29.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5da70d0e9b3fa82ba0203a3d90ad108c7f0bf2fefcadf36d37e7084970432c08
BLAKE2b-256 checksum
How to use checksums
e5c7c75b5ebdeac8b87d191c9c33852ae19e8054008f25169992e30affc8702b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

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

Download URL circuitpython_seeed_xiao_nrf52840-1.0.1-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a17946782a202a6e3bc1577d1b6632bb01302c97fe77ff47d1622f808a3970a4
BLAKE2b-256 checksum
How to use checksums
5ba273673aaaaf30f8a9af1008256ee63a3d45d1b091c2238c5edf4ed4e27170
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Security for circuitpython-seeed-xiao-nrf52840 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

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