No description
Find a file
2020-07-08 16:49:04 -04:00
.github/workflows build.yml: add black formatting check 2020-04-07 16:10:42 -05:00
adafruit_boardtest Ran black, updated to pylint 2.x 2020-03-20 12:03:00 -04:00
docs Black reformatting with Python 3 target. 2020-04-09 17:24:18 -04:00
examples Ran black, updated to pylint 2.x 2020-03-20 12:03:00 -04:00
.gitignore Moved repository from Travis to GitHub Actions 2020-01-01 15:00:22 -05:00
.pylintrc update pylintrc for black 2020-03-08 19:03:14 -05:00
.readthedocs.yml Did the cookiecutter dance. Files moved around to fit into standard Adafruit CircuitPython structure. 2018-12-14 08:07:25 -06:00
CODE_OF_CONDUCT.md update code of coduct: discord moderation contact section 2020-03-15 18:23:20 -05:00
LICENSE Did the cookiecutter dance. Files moved around to fit into standard Adafruit CircuitPython structure. 2018-12-14 08:07:25 -06:00
README.rst Fixed discord invite link 2020-07-08 16:49:04 -04:00
requirements.txt Added SD to lib requirements 2018-12-14 11:44:29 -06:00
setup.py.disabled Update wording. 2020-04-10 14:32:46 -04:00

Introduction
============

.. image:: https://readthedocs.org/projects/adafruit-circuitpython-boardtest/badge/?version=latest
    :target: https://circuitpython.readthedocs.io/projects/boardtest/en/latest/
    :alt: Documentation Status

.. image:: https://img.shields.io/discord/327254708534116352.svg
    :target: https://adafru.it/discord
    :alt: Discord

.. image:: https://github.com/adafruit/Adafruit_CircuitPython_BoardTest/workflows/Build%20CI/badge.svg
    :target: https://github.com/adafruit/Adafruit_CircuitPython_BoardTest/actions/
    :alt: Build Status

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:

* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_
* `Bus Device <https://github.com/adafruit/Adafruit_CircuitPython_BusDevice>`_
* `SD Card <https://github.com/adafruit/Adafruit_CircuitPython_SD>`_

Please ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloading
`the Adafruit library and driver bundle <https://github.com/adafruit/Adafruit_CircuitPython_Bundle>`_.

Usage Example
=============

You will need the following components:

* `Multimeter <https://www.adafruit.com/product/2034>`_
* 1x `LED <https://www.adafruit.com/product/299>`_
* 1x 330 Ohm resistor or `220 Ohm resistor <https://www.adafruit.com/product/2780>`_
* 2x `4.7k Ohm resistor <https://www.adafruit.com/product/2783>`_
* `Microchip 25AA040A SPI EEPROM <https://www.digikey.com/product-detail/en/microchip-technology/25AA040A-I-P/25AA040A-I-P-ND/1212469>`_
* `Microchip AT24HC04B I2C EEPROM <https://www.digikey.com/product-detail/en/microchip-technology/AT24HC04B-PU/AT24HC04B-PU-ND/1886137>`_
* 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.

.. image:: https://github.com/adafruit/Adafruit_CircuitPython_BoardTest/blob/master/docs/test_jig.png
    :alt: 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:

.. code:: python

    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]))


Contributing
============

Contributions are welcome! Please read our `Code of Conduct
<https://github.com/adafruit/Adafruit_CircuitPython_BoardTest/blob/master/CODE_OF_CONDUCT.md>`_
before contributing to help this project stay welcoming.

Documentation
=============

For information on building library documentation, please check out `this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.