Helper for verifying a board definition works as expected
Project description
Introduction
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:
1x LED
1x 330 Ohm resistor or 220 Ohm resistor
Breadboard
Wires
Connect the components as shown to your board. Note that you can use a 220 Ohm or 330 Ohm resistor for the LED.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file adafruit-circuitpython-boardtest-1.2.14.tar.gz
.
File metadata
- Download URL: adafruit-circuitpython-boardtest-1.2.14.tar.gz
- Upload date:
- Size: 353.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba4f1c5877a3f64333a49f8dd241947018925d729ff7b1c7c952d849023eb61d |
|
MD5 | 54416045fffa825d86c3be097f42013f |
|
BLAKE2b-256 | 6a7810f735fdd9bb0082d371b86305312e3045f9a295ef1004d98f801e03d3c8 |
File details
Details for the file adafruit_circuitpython_boardtest-1.2.14-py3-none-any.whl
.
File metadata
- Download URL: adafruit_circuitpython_boardtest-1.2.14-py3-none-any.whl
- Upload date:
- Size: 18.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68dfb02abc82348d22fabb57b7d76b47570804138b344ceab190c9735c9ecfea |
|
MD5 | b193d62a5ee62f2e3b292ee02aad0bf2 |
|
BLAKE2b-256 | 5ed0a576d2b0c5d6566f9dcddca283c5d7da2658ecded2a7be2049e309e4851a |