rwaldron / johnny-five

JavaScript Robotics and IoT programming framework, developed at Bocoup.
http://johnny-five.io
Other
13.26k stars 1.76k forks source link

Any example how to flash code onto board to work without computer #1367

Closed alzalabany closed 7 years ago

alzalabany commented 7 years ago

For example in getting started

var five = require("johnny-five"),
    board = new five.Board();

board.on("ready", function() {
  // Create an Led on pin 13
  var led = new five.Led(13);

  // Strobe the pin on/off, defaults to 100ms phases
  led.strobe();
});

Run this and now led light, now how can i disconnect from pc and still keel code worling ¿

dtex commented 7 years ago

Hi @alzalabany I assume you are using an Arduino connected to your PC with a USB cable.

The short answer is you cannot do that. The sketch that is running on the Arduino (firmata) is a client that gets all of its instructions from a host server (your pc).

The long answer is that you can do that with a different micro-controller, or find a different way to connect to your micro-controller from your PC. Check out these options:

You can run your host server in an onboard linux environment. I think the Tessel 2 is a great option for that.

You can connect to the micro-controller over wifi

You can connect to the micro-controller over bluetooth

You can also connect your PC to an Arduino using Xbee radios (which are pretty neat).

rwaldron commented 7 years ago

Thanks @dtex!