/ README.rst
README.rst
  1  Introduction
  2  ============
  3  
  4  .. image:: https://readthedocs.org/projects/adafruit-circuitpython-amg88xx/badge/?version=latest
  5      :target: https://circuitpython.readthedocs.io/projects/amg88xx/en/latest/
  6      :alt: Documentation Status
  7  
  8  .. image :: https://img.shields.io/discord/327254708534116352.svg
  9      :target: https://adafru.it/discord
 10      :alt: Discord
 11  
 12  .. image:: https://github.com/adafruit/Adafruit_CircuitPython_AMG88xx/workflows/Build%20CI/badge.svg
 13      :target: https://github.com/adafruit/Adafruit_CircuitPython_AMG88xx/actions/
 14      :alt: Build Status
 15  
 16  
 17  Adafruit CircuitPython module for the AMG88xx GRID-Eye IR 8x8 thermal camera.
 18  
 19  Dependencies
 20  =============
 21  This driver depends on:
 22  
 23  * `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_
 24  * `Bus Device <https://github.com/adafruit/Adafruit_CircuitPython_BusDevice>`_
 25  * `Register <https://github.com/adafruit/Adafruit_CircuitPython_Register>`_
 26  
 27  Please ensure all dependencies are available on the CircuitPython filesystem.
 28  This is easily achieved by downloading
 29  `the Adafruit library and driver bundle <https://github.com/adafruit/Adafruit_CircuitPython_Bundle>`_.
 30  
 31  Installing from PyPI
 32  ====================
 33  
 34  On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
 35  PyPI <https://pypi.org/project/adafruit-circuitpython-amg88xx/>`_. To install for current user:
 36  
 37  .. code-block:: shell
 38  
 39      pip3 install adafruit-circuitpython-amg88xx
 40  
 41  To install system-wide (this may be required in some cases):
 42  
 43  .. code-block:: shell
 44  
 45      sudo pip3 install adafruit-circuitpython-amg88xx
 46  
 47  To install in a virtual environment in your current project:
 48  
 49  .. code-block:: shell
 50  
 51      mkdir project-name && cd project-name
 52      python3 -m venv .env
 53      source .env/bin/activate
 54      pip3 install adafruit-circuitpython-amg88xx
 55  
 56  Usage Example
 57  =============
 58  
 59  Of course, you must import the library to use it:
 60  
 61  .. code-block:: python
 62  
 63      import busio
 64      import adafruit_amg88xx
 65  
 66  The way to create an I2C object depends on the board you are using. For boards with labeled SCL and SDA pins, you can:
 67  
 68  .. code-block:: python
 69  
 70      import board
 71  
 72  You can also use pins defined by the onboard microcontroller through the microcontroller.pin module.
 73  
 74  Now, to initialize the I2C bus:
 75  
 76  .. code-block:: python
 77  
 78      i2c_bus = busio.I2C(board.SCL, board.SDA)
 79  
 80  Once you have created the I2C interface object, you can use it to instantiate the AMG88xx object
 81  
 82  .. code-block:: python
 83  
 84      amg = adafruit_amg88xx.AMG88XX(i2c_bus)
 85  
 86  You can also optionally use the alternate i2c address (make sure to solder the jumper on the back of the board if you want to do this)
 87  
 88  .. code-block:: python
 89  
 90      amg = adafruit_amg88xx.AMG88XX(i2c_bus, addr=0x68)
 91  
 92  Pixels can be then be read by doing:
 93  
 94  .. code-block:: python
 95  
 96      print(amg.pixels)
 97  
 98  
 99  Contributing
100  ============
101  
102  Contributions are welcome! Please read our `Code of Conduct
103  <https://github.com/adafruit/Adafruit_CircuitPython_LIS3DH/blob/master/CODE_OF_CONDUCT.md>`_
104  before contributing to help this project stay welcoming.
105  
106  Documentation
107  =============
108  
109  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>`_.