Skip to main content

Helper for verifying a board definition works as expected

Project description

Introduction

Documentation Status Discord Build Status Code Style: Black

Board test suite for CircuitPython. Run these tests to ensure that a CircuitPython port was created correctly, individual pin mappings are correct, and buses (e.g. SPI) work.

Tests can be run individually. Copy code found in each boardtest_<name>.py module to your CIRCUITPYTHON device drive, and rename the file code.py.

Alternatively, tests can be imported as modules. Copy the desired test file to CIRCUITPYTHON device drive and import the test in your own code. Each test can be run with the run_test(pins) function.

The boardtest_simpletest.py (in examples/) shows how to call tests from within a script. boardtest_simpletest.py runs the following tests:

  • LED Test

  • GPIO Test

  • Voltage Monitor Test

  • UART Test

  • SPI Test

  • I2C Test

Dependencies

This test suite depends on:

Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle.

Usage Example

You will need the following components:

Connect the components as shown to your board. Note that you can use a 220 Ohm or 330 Ohm resistor for the LED.

Test jig Fritzing diagram

To use each test, copy the individual .py or .mpy test(s) into a folder named adafruit_boardtest in the CIRCUITPY drive, import the library, find the pins available on your board, and call boardtest_<test name>.run_test(pins). To run the GPIO test, for example:

import board
from adafruit_boardtest import boardtest_gpio

# List out all the pins available to us
pins = [p for p in dir(board)]
print()
print("All pins found:", end=' ')

# Print pins
for p in pins:
    print(p, end=' ')
print('\n')

# Run test
result = run_test(pins)
print()
print(result[0])
print("Pins tested: " + str(result[1]))

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.

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

adafruit-circuitpython-boardtest-1.2.20.tar.gz (352.0 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file adafruit-circuitpython-boardtest-1.2.20.tar.gz.

File metadata

File hashes

Hashes for adafruit-circuitpython-boardtest-1.2.20.tar.gz
Algorithm Hash digest
SHA256 9eee4d80e550de2252a48a296f76b0ffb39484c2d6c782a6c13a9405605a665e
MD5 3986d3484804cdbfb341a6b5e0707a57
BLAKE2b-256 e60f58766f147b6701c0869874648d9bdc1592ff0ebd759e6febf128321dea3e

See more details on using hashes here.

File details

Details for the file adafruit_circuitpython_boardtest-1.2.20-py3-none-any.whl.

File metadata

File hashes

Hashes for adafruit_circuitpython_boardtest-1.2.20-py3-none-any.whl
Algorithm Hash digest
SHA256 50cc4acf99860a14fdb87c82ade22290ef7aa9d16a4c13f220a734ec24893cd6
MD5 690e5c8794f43d907d3510aae332165e
BLAKE2b-256 d4ffd5606baa3ab2509b7f3a9419a33f773459b10b9f362c3dde396a2e6c0299

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