# sakuraio-i2c

> SAKURA Internet IoT Communication Module Library for NodeJS using I2c bus

Latest version **0.1.0** (published 2018-04-10) · ISC license · 0 weekly downloads

## Install

```sh
npm install sakuraio-i2c
pnpm add sakuraio-i2c
yarn add sakuraio-i2c
bun add sakuraio-i2c
```

## Health

**Score 5/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score; declining downloads.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2018-04-10 |
| First published | 2018-04-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 5.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Malik Olivier Boussejra |
| Maintainers | malikolivier |

## Links

- npm: https://www.npmjs.com/package/sakuraio-i2c
- Homepage: https://github.com/malikolivier/node-sakuraio-i2c
- Issues: https://github.com/malikolivier/node-sakuraio-i2c/issues
- npm.io page: https://npm.io/package/sakuraio-i2c

## Dependencies (3)

- [debug](https://npm.io/package/debug.md) ^3.0.0
- [i2c-bus](https://npm.io/package/i2c-bus.md) ^1.2.2
- [sakuraio](https://npm.io/package/sakuraio.md) ^0.1.0

## Recent versions

- 0.1.0 (latest) — 2018-04-10
- 0.0.2 — 2018-04-10
- 0.0.1 — 2018-04-10

## README

# node-sakuraio-i2c

SAKURA Internet IoT Communication Module Library for NodeJS using I2c bus.
Should work on most Linux board like the Raspberry Pi, C.H.I.P., BeagleBone
or Intel Edison. All methods have asynchronous and synchronous forms.

Currently only Node 7 or more are supported (it may work on Node 6).
I2c communication is handled through [i2c-bus](https://github.com/fivdi/i2c-bus#busreadbyteaddr-cmd-cb).
Please refer to i2c-bus documentation if you meet compilation issues or for
I2c setup.

# Disclaimer

This project is not affiliated with sakura.io and is licensed under the very
permissive ISC license. Use it at your own risk.

# Installation

```
$ npm install sakuraio-i2c
```

# Example

## Asynchronous example

```js
const SakuraIOI2c = require('sakuraio-i2c')

const BUS_NO = 2

SakuraIOI2c.open(BUS_NO, function (err, bus) {
  if (err) throw err
  else {
    bus.getConnectionStatus(function (err, status) {
      console.log('Connection status', status)
    })
  }
})
```

## Synchronous example

```js
const SakuraIOI2c = require('sakuraio-i2c')

const BUS_NO = 2

var bus = SakuraIOI2c.openSync(BUS_NO)
var status = bus.getConnectionStatusSync()
console.log(status)
```

# API specification

## SakuraIOI2c.open(busNo, cb)
* busNo: I2c bus number (integer)
* cb: function (err, bus)
  * bus: Bus object

## SakuraIOI2c.openSync(busNo)
* busNo: I2c bus number (integer)
* returns: Bus object

The returned bus object can the be used to communicate with the SakuraIO module.
Documentation regarding the bus object is bound in the [node-sakuraio](https://github.com/malikolivier/node-sakuraio)
README.

---
_Source: https://npm.io/package/sakuraio-i2c · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
