rwaldron/johnny-five — pull request #497 by BrianGenisio (2014-11-15 02:34:12+00:00)
Title: Support for IR Reflectance array

# Reflectance Array Support

This adds support for analog IR Reflectance Arrays like [these from Pololu](http://www.pololu.com/product/960).

*note*: I still need to write an example and documentation. I'd like to get feedback on this PR before I finish that.
*note*: This only works for analog reflectance arrays. Digital arrays use pulse length encoding which is very hard to achieve without a modified Firmata.

Here is some [example code](https://gist.github.com/BrianGenisio/ae315650d5dbdeba996e) for a line follower and [a video](https://www.youtube.com/watch?v=i6n4CwqQer0) showing it in action.

## You construct it like this:

```js
new five.IR.Reflect.Array({
emitter: 13,
pins: ['A0', 'A1', 'A2', 'A3', 'A4', 'A5'],
freq: 20
});
```
## It has the following public methods:

* enable
* disable
* calibrate
* calibrateUntil
* loadCalibration

## It has the following public property getters:

* isOn
* isCalibrated
* isOnLine
* sensors
* calibration
* raw
* values
* line

## It emits the following events:

* data
* calibratedData
* line