i2cdriver/python/docs/index.rst

95 lines
2.0 KiB
ReStructuredText
Raw Permalink Normal View History

2021-02-10 14:50:23 +00:00
i2cdriver
=========
2020-01-16 20:08:41 +00:00
2021-02-10 16:24:17 +00:00
.. image:: /images/i2cdriver-hero-800.jpg
2023-02-07 23:00:50 +00:00
:target: https://i2cdriver.com
2021-02-10 16:24:17 +00:00
2023-02-07 23:00:50 +00:00
`I²CDriver <https://i2cdriver.com>`_
2021-02-10 16:24:17 +00:00
is an easy-to-use, open source tool for controlling I²C devices over USB.
2021-02-10 14:50:23 +00:00
It works with Windows, Mac, and Linux, and has a built-in color screen
that shows a live "dashboard" of all the I²C activity.
2020-01-16 20:08:41 +00:00
.. toctree::
:maxdepth: 2
2021-02-10 14:50:23 +00:00
:caption: Contents:
2020-01-16 20:08:41 +00:00
2021-02-10 16:27:26 +00:00
The I²CDriver User Guide has complete information on the hardware:
2020-01-16 20:08:41 +00:00
2021-02-10 14:50:23 +00:00
https://i2cdriver.com/i2cdriver.pdf
2020-01-16 20:08:41 +00:00
System Requirements
2021-02-10 14:50:23 +00:00
===================
2020-01-16 20:08:41 +00:00
Because it is a pure Python module, ``i2cdriver`` can run on any system supported by ``pyserial``.
This includes:
- Windows 7 or 10
- Mac OS
- Linux, including all Ubuntu distributions
Both Python 2.7 and 3.x are supported.
Installation
------------
The ``i2cdriver`` package can be installed from PyPI using ``pip``::
$ pip install i2cdriver
Quick start
-----------
To connect to the I2CDriver and scan the bus for connected devices::
>>> import i2cdriver
>>> i2c = i2cdriver.I2CDriver("/dev/ttyUSB0")
>>> i2c.scan()
-- -- -- -- -- -- -- --
-- -- -- -- -- -- -- --
-- -- -- -- 1C -- -- --
-- -- -- -- -- -- -- --
-- -- -- -- -- -- -- --
-- -- -- -- -- -- -- --
-- -- -- -- -- -- -- --
-- -- -- -- -- -- -- --
48 -- -- -- -- -- -- --
-- -- -- -- -- -- -- --
-- -- -- -- -- -- -- --
-- -- -- -- -- -- -- --
68 -- -- -- -- -- -- --
-- -- -- -- -- -- -- --
[28, 72, 104]
To read the temperature in Celsius from a connected LM75 sensor:
>>> d=i2cdriver.EDS.Temp(i2c)
>>> d.read()
17.875
>>> d.read()
18.0
The User Guide at https://i2cdriver.com has more examples.
Module Contents
---------------
.. autoclass:: i2cdriver.I2CDriver
:member-order: bysource
:members:
setspeed,
setpullups,
scan,
reset,
start,
read,
write,
stop,
regwr,
regrd,
getstatus,
monitor
.. autoclass:: i2cdriver.START
.. autoclass:: i2cdriver.STOP
.. autoclass:: i2cdriver.BYTE