Skip to content

Latest commit

 

History

History
94 lines (79 loc) · 5.38 KB

README.md

File metadata and controls

94 lines (79 loc) · 5.38 KB

Arduino Library for TI TLC59116 LED-driver (#BRANCH#)

This provides a high level interface:

  • Makes it easier to get started.
    • Discovers the devices.
    • Provides useful defaults.
  • Provides most features.
  • Provides operations at the feature level (like "turn on channel 4").
    • Manages the subfields and state of the device registers.
    • i.e.: only update the bits to turn channel 5 on, without stomping the other channels.
    • So you don't have to, which minimizes bugs.
    • Optimizes some communications with the device.
  • Allows the friendlier "." notation, so you don't have to remember when to use "->".
  • Provides a low-level interface if you don't want the state managed.

Requirements

  1. An Arduino that is I2C capable, and works with the Wire library.
  2. Arduino IDE version 1.0.5, or 1.0.4. There is a bug that causes a problem in 1.0.6.
  3. At least one TLC59116, wired up and hooked to the default I2C pins of your Arduino.
    1. Something on the outputs, otherwise it's real boring.

I have not tested this with any Makefile setups. Please send me info on how that works for you.

Installation

  1. Download the library zip file.
  2. Add the library to the Arduino IDE
    1. (cf. the official instructions)
    2. For Arduino IDE 1.0.5:
      1. Sketch -> Import Library -> Add Library
      2. Then select the downloaded arduino_TLC59116.zip.
    3. For earlier versions, follow the "Manual" section of http://www.arduino.cc/en/guide/libraries.

Getting Started

  1. Wire things up. Someone should write a how-to!
  2. Try the examples.
    1. "examples/basic_usage_single" is the same code as show in the "Usage" section of TLC59116 Class
      1. Open it.
      2. Do the Upload thing.
      3. Oooh. Blinky light.
    2. "examples/test_features" wants you to interact with the serial-console.
      1. Type single-letter commands into the top box, and click send. Try "?".
      2. It has a bunch of behaviors, useful for testing the TLC59116 and your wiring prowess.
    3. "examples/allfeatures" is the source of most of the examples in the documenation.
      1. It compiles.
      2. It probably is not useful to actually run.
      3. But, you can copy & paste from it.
    4. "examples/tlc59116blink" is what I use to do quick tests of wired-up devices.
      1. Read it's comments!
  3. Browse the TLC59116 Class documentation page:
    1. The "Protocol" section describes the order you have to do things.
    2. Further down, the Public Methods section has groups of operations (like "Digital" and "PWM").
      1. (you probably want to ignore that first list of methods)
      2. There's usually a short description of each method.
      3. For example-code, explanations, and more details, click on the method-name.

Documentation

HTML documentation, with examples, and explanation:

Developing

  1. Everything should be in the github repository.
  2. Clone it to mess around. Fork it to keep track of the messing around.
  3. I'm happy to consider pull-requests, especially for bug-fixes, documentation issues, and missing functions.
    1. Please maintain a high-level of documentation.
  4. Requirements for developing:
    1. Source control is by git, with a repository on github.
    2. Documentation is generated by doxygen: doxygen Doxyfile
    3. The .zip files are constructed by gnu-make:
    4. Several other files are constructed by gnu-make (e.g. README.html)
    5. My makefile is idiosyncratic. I need to fix that:
    6. supposedly "make" makes everything, silently.
    7. "make release" constructs everything and pushes to "github".
      1. It tries to be tolerant of missing tools.
      2. It touches up a few files to insert the git-branch as the version.
    8. Releasing to github is by rules in the makefile, signaled by a flag file ".master-is-release"
      1. make release

Credits

  1. I2C scan function adapted from Nick Gammon (written 20th April 2011), http://www.gammon.com.au/forum/?id=10896&reply=6#reply6. Thanks Nick!
  2. Bug fix to milliamps(), and updated for Arduino 1.8+, by Red Byer aka github mizraith. Thanks!
  3. library.properties and keywords.txt fixes by perl1234
  4. more library.properties fixes by jmkao