# odroid-io

> Odroid C2 I/O Plugin for Jonnhy-Five based on linux-io

Latest version **1.0.3** (published 2018-11-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install odroid-io
pnpm add odroid-io
yarn add odroid-io
bun add odroid-io
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2018-11-29 |
| First published | 2018-11-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4.0.0 |
| Dependencies | 4 |
| Unpacked size | 22.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Lucas Teske |
| Maintainers | racerxdl |
| Keywords | linux, johnny-five, odroid, hardkernel |

## Links

- npm: https://www.npmjs.com/package/odroid-io
- Repository: https://github.com/racerxdl/odroid-io
- Homepage: https://github.com/racerxdl/odroid-io#readme
- Issues: https://github.com/racerxdl/odroid-io/issues
- npm.io page: https://npm.io/package/odroid-io

## Dependencies (4)

- [onoff](https://npm.io/package/onoff.md) ^3.2.2
- [i2c-bus](https://npm.io/package/i2c-bus.md) ^4.0.2
- [board-io](https://npm.io/package/board-io.md) ^3.0.5
- [mutexify](https://npm.io/package/mutexify.md) ^1.2.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2018-11-29
- 1.0.2 — 2018-11-29
- 1.0.0 — 2018-11-29

## README

# ODROID-IO

ODROID-IO is a Johnny-Five I/O Plugin for Odroid C2
[IO Plugin](https://github.com/rwaldron/io-plugins) for
[Johnny-Five](https://github.com/rwaldron/johnny-five). It extends
[board-io](https://github.com/achingbrain/board-io) to provide Linux
implementations for the following features that IO Plugins can support:

 * Digital IO
   * Implementation based on the [GPIO sysfs interface](https://www.kernel.org/doc/Documentation/gpio/sysfs.txt) using [onoff](https://github.com/fivdi/onoff)
 * I2C
   * Implementation based on the [/dev interface](https://www.kernel.org/doc/Documentation/i2c/dev-interface) using [i2c-bus](https://github.com/fivdi/i2c-bus)

## Installation

```
npm install odroid-io
```

## Johnny-Five Features Supported

The Johnny-Five features supported by a platform are summarized in tables on
the [Platform Support](http://johnny-five.io/platform-support/) page. The
features supported by Linux-IO shown in the following table:

Feature | Support
:--- | :---
Analog Read | yes
Digital Read | yes
Digital Write | yes
PWM | no
Servo | no
I2C | yes
One Wire | no
Stepper | no
Serial/UART | no
DAC | no
Ping | no

## Usage

Here's a minimalistic IO Plugin for the Raspberry Pi called
[TinyRaspberryPiIO](https://github.com/fivdi/linux-io/blob/master/example/raspberry-pi/tiny-raspberry-pi-io.js)
that allows digital IO on GPIO4 and GPIO17 and I2C serial bus access on I2C
bus 1. The built-in LED can also be used.

```js
'use strict';

var five = require('johnny-five');
var OdroidIO = require('./odroid-io');

var board = new five.Board({
  io: new OdroidIO()
});

board.on('ready', function() {
  console.log('Board Ready');
  var adc = new five.Pin({
  pin: 'A0',
  type: 'analog',
  });
  adc.read(function(err, val) {
  if (err) {
    console.log('Error reading ADC: ', err);
  } else {
    console.log('ADC Value: ' + val);
  }
  });
});

```

If an ADXL345 accelerometer is connected to I2C bus 1, the following
[program](https://github.com/fivdi/linux-io/blob/master/example/raspberry-pi/i2c-accelerometer.js)
will print information provided by accelerometer.

```js
var five = require('johnny-five');
var OdroidIO = require('odroid-io');

var board = new five.Board({
  io: new OdroidIO()
});

board.on('ready', function() {
  var accelerometer = new five.Accelerometer({
    controller: "ADXL345"
  });

  accelerometer.on("change", function() {
    console.log("accelerometer");
    console.log("  x            : ", this.x);
    console.log("  y            : ", this.y);
    console.log("  z            : ", this.z);
    console.log("  pitch        : ", this.pitch);
    console.log("  roll         : ", this.roll);
    console.log("  acceleration : ", this.acceleration);
    console.log("  inclination  : ", this.inclination);
    console.log("  orientation  : ", this.orientation);
    console.log("--------------------------------------");
  });
});
```

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