Skip to content

Instantly share code, notes, and snippets.

@monteslu
Created April 27, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save monteslu/553760e27ca59fbf9b10 to your computer and use it in GitHub Desktop.
Save monteslu/553760e27ca59fbf9b10 to your computer and use it in GitHub Desktop.
j5 from a tcp socket client
var net = require('net');
var five = require('johnny-five');
var options = {
host: 'localhost', //any tcp host
port: 3001 // any port
};
var client = net.connect(options);
var board = new five.Board({port: client});
board.on('ready', function(){
console.log('five ready');
//Full Johnny-Five support here:
var led = new five.Led(13);
led.blink(500);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment