{ "info": { "author": "Cameron Little", "author_email": "cameron@camlittle.com", "bugtrack_url": null, "classifiers": [], "description": "# RGB LED Driver\n\nThis software can be used to drive an analog RGB LED strip using a raspberry pi\nand Adafruit's [16-channel 12-bit PWM/Servo Driver - PCA9685](https://raw2.github.com/apexskier/rgbLED/master/LED_Strip_bb.png):\n\n## The Circuit\n\nHere's the basic idea:\n\n - Hook up the pi to the PCA9685 breakout board using the I2C connections.\n - Connect the pi's 3.3V output to VCC on the PCA9685 breakout board. Leave V+\n floating.\n - Follow this tutorial for the RGB LED strips:\n http://learn.adafruit.com/rgb-led-strips/usage\n - I used N-channel MOSFETs - three of them, one for each channel\n - Connect the +12V from the LED strip to an external power supply (do NOT\n use your pi for this!)\n - Connect the ground side of the power supply to the pi ground\n - Instead of using the PWM outputs from the arduino, we'll use the PWM\n outputs from the PCA9685.\n - Connect up the PWM output 0 to the MOSFET with the red wire from the\n LED strip. Output 1 goes to green, output 2 goes to blue.\n\n![Breadboard image](https://raw2.github.com/apexskier/rgbLED/master/LED_Strip_bb.png)\n\n\n## Dependencies\n\n- [WiringPi2 Python](https://github.com/WiringPi/WiringPi2-Python)\n\n## Usage\n\nThis program is designed to be included as a python module, but also has some\ncommand line options. It, or any python code importing it, must be run as root\n(sudo), because of the I2C interface.\n\n### CLI Options\n\n- `-c [hex color]` - Sets the led strip to the color specified.\n- `-t` - Runs a test of a couple things. Use as a demo.\n- `-o` - Turn the led strip off after other actions.\n\n### As a module\n\n```\nfrom rgbDriver import RGBDriver\nrgb_driver = RGBDriver()\n```\n\nMethods in the module use tuples to describe rgb colors: `(red_value,\ngreen_value, blue_value)`. Each color value can range between 0 and 4095, due\nto the PWM driver's 12 bit resolution. The `convert_eight_to_twelve_bit()`\nmethod can convert a standard 0 to 255 color value to this scale.\n\nTo describe a color you can use the string representation of a hex color code\nand the method `hex_to_rgb()` to convert it or `set_hex_color()` and\n`to_hex_color()` to use it directly.\n\nThe driver keeps a property `current_color` that stores the led strip's current\ncolor (in theory). This is used internally to smoothly transition from one\ncolor to another.\n\nTwo types of color setting methods exist. `to_...` will transition a color\nchange over a set time. The last argument of any `to_...` method is that\ntransition time in milliseconds (default 300ms). `set_...` will set a color\nimmediately.\n\nCurrently supported methods are:\n\n- `to_rgb(rgb, fade=DEFAULT)`, `set_rgb(rgb)`\n- `to_rand(r_range=(0, 4095), g_range=(0, 4095), b_range=(0, 4095), fade=DEFAULT)`, `set_rand(r_range=(0, 4095), g_range=(0, 4095), b_range=(0, 4095))`\n- `to_hex_color(color, fade=DEFAULT)`, `set_hex_color(color)`\n\n\n## TODO\n\n- I've got a basic single color led strip and an extra N-channel MOSFET that I\n want to control.\n- Set current_color var after setting up pwm.\n\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/apexskier/ledDriver", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "ledDriver", "package_url": "https://pypi.org/project/ledDriver/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/ledDriver/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/apexskier/ledDriver" }, "release_url": "https://pypi.org/project/ledDriver/1.0/", "requires_dist": null, "requires_python": null, "summary": "Python LED light strip and PWM drivers using the WiringPi2 library.", "version": "1.0" }, "last_serial": 1016593, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "23d9d0f88095878ccdc4750e1d7a3f3f", "sha256": "a0ccef0fd51f5154d64730c72ef75c0b8d414e77f505046536ef1c9a81bad19c" }, "downloads": -1, "filename": "ledDriver-1.0.tar.gz", "has_sig": false, "md5_digest": "23d9d0f88095878ccdc4750e1d7a3f3f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5465, "upload_time": "2014-03-02T20:35:04", "url": "https://files.pythonhosted.org/packages/9b/0c/8ff29ee8f2120b36ff6fa3b031736984e2470c72d191cbdac6ce9df2fae7/ledDriver-1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "23d9d0f88095878ccdc4750e1d7a3f3f", "sha256": "a0ccef0fd51f5154d64730c72ef75c0b8d414e77f505046536ef1c9a81bad19c" }, "downloads": -1, "filename": "ledDriver-1.0.tar.gz", "has_sig": false, "md5_digest": "23d9d0f88095878ccdc4750e1d7a3f3f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5465, "upload_time": "2014-03-02T20:35:04", "url": "https://files.pythonhosted.org/packages/9b/0c/8ff29ee8f2120b36ff6fa3b031736984e2470c72d191cbdac6ce9df2fae7/ledDriver-1.0.tar.gz" } ] }