Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/monteslu/remote-io
Remote control ANY Johnny-Five IO class via a virtual serialport
https://github.com/monteslu/remote-io
Last synced: 15 days ago
JSON representation
Remote control ANY Johnny-Five IO class via a virtual serialport
- Host: GitHub
- URL: https://github.com/monteslu/remote-io
- Owner: monteslu
- Created: 2014-11-26T01:05:15.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-06-12T03:00:18.000Z (over 8 years ago)
- Last Synced: 2024-12-29T11:23:33.583Z (30 days ago)
- Language: JavaScript
- Size: 83 KB
- Stars: 22
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
- awesome-nodebots - Remote-IO - Firmata Compatiblity IO Plugin for remote interaction with Johnny-Five. (Libraries and Plugins / IO Compatibility Plugins)
README
# Remote-io
[![Join the chat at https://gitter.im/monteslu/remote-io](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/monteslu/remote-io?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Remote-io is a Firmata-compatibility IO class for writing [nodebot](http://nodebots.io/) programs and provides remote interaction with any other [Johnny-Five](https://github.com/rwaldron/johnny-five) capable IO class.
Remote-io was built at [IcedDev](http://iceddev.com/)
### Installation
`npm install remote-io`
### Usage
![Remote-IO](remoteio.png)
The little devices on the right side of this image are running this common bit of code with an IO class instance specified:
```javascript
var RemoteIO = require('remote-io');//The "io" variable here could be any instance of bean-io, rpi-io, etc.
io.on('ready', function(){//listen for remote firmata messages
var remoteio = new RemoteIO({
serial: sp, //any virtual serial port instance
io: io
});});
```
Now for the laptop on the left side of the picture, you can simply write johnny-five code that uses a virtual serial port. Your code uses the typical firmata IO class to talk to the remote-io instances.
```javascript
var five = require('johnny-five');
var firmata = require('firmata');//The "sp" variable here could be any instance of a virtual serial port
var io = new firmata.Board(sp);var board = new five.Board({io: io});
board.on('ready', function(){
var led = new five.Led(13);
led.blink();
});```
### API
Remote-io subclasses firmata.js and provides the same API.