<commit_before>## Rx.js library for LSM303DLHC I2C 3D compass and accelerometer module

[![NPM version](https://badge.fury.io/js/lsm303-rx.svg)](http://badge.fury.io/js/lsm303-rx)

This is an npm module that creates [Rx.JS](https://github.com/Reactive-Extensions/RxJS)
streams of readings from the LSM303 I2C 3D compass and accelerometer module.
Information on the LSM303DLHC can be found
[here](http://www.st.com/web/catalog/sense_power/FM89/SC1449/PF251940)
and it is available for purchase at
[Adafruit](http://www.adafruit.com/products/1120).


## Usage

```js
var i2c = require("i2c-bus");
var Lsm303Driver = require("lsm303-rx");

var options = {
    // looking at the source code, the synchronous and
    // asynchronous open functions are identical
    i2c: i2c.openSync(1)
};

lsm303 = new Lsm303Driver(options);

console.log('Reading 10 headings...');
lsm303.streamHeadings(500) // sample every 500 ms
    .take(10)
    .subscribe(
        function (heading) {
            console.log('Next: ' + heading);
        },
        function (err) {
            console.log('Error: ' + err);
        },
        function () {
            console.log('Completed');
        }
    );
```

Note that you need to open the [`i2c-bus`](https://npmjs.org/package/i2c-bus)
and pass it in to the module.
<commit_msg>Fix README<commit_after>## Rx.js library for LSM303DLHC I2C 3D compass and accelerometer module

[![NPM version](https://badge.fury.io/js/lsm303-rx.svg)](http://badge.fury.io/js/lsm303-rx)

This is an npm module that creates [Rx.JS](https://github.com/Reactive-Extensions/RxJS)
streams of readings from the LSM303 I2C 3D compass and accelerometer module.
Information on the LSM303DLHC can be found
[here](http://www.st.com/web/catalog/sense_power/FM89/SC1449/PF251940)
and it is available for purchase at
[Adafruit](http://www.adafruit.com/products/1120).


## Usage

```js
var i2c = require("i2c-bus");
var Lsm303Driver = require("lsm303-rx").Lsm303Driver;

var options = {
    // looking at the source code, the synchronous and
    // asynchronous open functions are identical
    i2c: i2c.openSync(1)
};

lsm303 = new Lsm303Driver(options);

console.log('Reading 10 headings...');
lsm303.streamHeadings(500) // sample every 500 ms
    .take(10)
    .subscribe(
        function (heading) {
            console.log('Next: ' + heading);
        },
        function (err) {
            console.log('Error: ' + err);
        },
        function () {
            console.log('Completed');
        }
    );
```

Note that you need to open the [`i2c-bus`](https://npmjs.org/package/i2c-bus)
and pass it in to the module.

{'fraction_non_alphanumeric': 0.13986280487804878, 'fraction_numerical': 0.052210365853658534, 'mean_word_length': 3.0824261275272162, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3327045', 'n_tokens_mistral': 992, 'n_tokens_neox': 877, 'n_words': 225}