You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Please ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloading
the Adafruit library and driver bundle.
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:
importboardfromadafruit_boardtestimportboardtest_gpio# List out all the pins available to uspins= [pforpindir(board)]
print()
print("All pins found:", end=' ')
# Print pinsforpinpins:
print(p, end=' ')
print('\n')
# Run testresult=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.
About
Helper for verifying a board definition works as expected