This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
# Python bindings for APDS-9930
Python module for the APDS-9930 I2C Ambient Light and Proximity sensor

This is a Python port of the [AVR APDS-9930 library](https://github.com/Davideddu/APDS9930)

Simple and easy to use. Makes heavy use of Python-specific programming concepts, such as properties, to make usage even easier. Depends on `python-smbus`, the I2C library for Python.

I tested this on Linux a desktop computer, using the I2C pins of a nVidia graphics card, using the Nouveau graphics driver. This has been reported to work for both ATI and nVidia cards, but not for integrated Intel (and I can confirm this).

Check the pinout:

![Graphics-I2C pinout](http://members.dslextreme.com/users/paintyourdragon/img/i2c/port-vga.png)

* Grey: ground
* Red: +5V
* Yellow: clock
* Blue: serial data

You may want to read [this article](http://www.paintyourdragon.com/?p=43) for more information and more pinouts.

It should work on Raspberry PI.

## Basic usage

**Note:** more detailed usage and documentation coming soon.

Load the `i2c-dev` kernel module.

```
sudo modprobe i2c-dev
```

Install `i2c-tools` to get the `i2cdetect` program, useful to scan for I2C devices.

```
sudo apt-get install i2c-tools
```

List the I2C buses

```
sudo i2cdetect -l
```

Connect the device to the I2C pins, then scan every bus until you find the device. Device should have address 0x39.

```
sudo i2cdetect -y <bus number="">

# Sample good output
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- 39 -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
```

Once you have found the correct bus, run Python as root and import the module.

```
sudo python

>>> from apds9930 import APDS9930
```

Open the bus

```
>>> a = APDS9930(bus_number)
```

That's it! Use Python's help function to retrieve the documentation (which is yet to be generated).

```
>>> help(APDS9930)
```
Release History

Release History

0.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting