Skip to main content

Raspberry Pi I2C library

Project description

rpI2C

rpI2C is a Raspberry-Pi I2C Library

Setup

How to use

Installing rpI2C

Installing from pip

$ pip install rpI2C

Installing from source

$ python setup.py install

Example Script

import rpI2C

address = 0x18
bus = rpI2C.I2C(address)
data = bus.read_raw_byte()
bus.write_raw_byte(0x00)
bus.clean_up()

Bus Value

On different versions of the Raspberry-Pi you will need to use a different bus value for the I2C bus. On some it’s ‘0’ and others it’s ‘1’. This library tries to connect to bus ‘0’ first and if that fails, it will connect to bus ‘1’. You can specify a bus manually in the initializer.

bus = rpI2C.I2C(address, bus=0)

Contributing

Send ideas through github issues.

Send patches through pull requests.

Code should ideally:

  • Follow PEP8

  • Generate no pyflakes warnings

License

Written by Fernando Chorney Released under the MIT License: http://www.opensource.org/licenses/mit-license.php

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rpI2C-1.0.0.tar.gz (3.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page