How do I persist a JavaScript program onto the Arduino board so that it runs by default next time any power source is provided?
I recently purchased the Johnny-Five Inventor's Kit which comes with a Tessel 2. Tessel provides a CLI that allows me to "push" JavaScript to the board as the default application to run when power is supplied. I'm looking to do the same type of thing with Arduino. Is this even possible? Or is it necessary to be connected to the computer via USB to run the JavaScript?
I can upload the "StandardFirmata" sketch to the Arduino which allows me to run JavaScript when connected via USB. But it doesn't persist after exiting the program.
"it" is a pronoun with no referent. What doesn't persist? If you loaded StandardFirmata, that sketch WILL be there the next time the Arduino resets. What program are you exiting?
"I can upload the "StandardFirmata" sketch to the Arduino which allows me to run JavaScript when connected via USB."
I doubt that, if there's any javascript running, it happens on the computer/device on the other end of the USB cable, not arduino. And that's why it doesn't "persist" on arduino.
PaulS:
"it" is a pronoun with no referent. What doesn't persist? If you loaded StandardFirmata, that sketch WILL be there the next time the Arduino resets. What program are you exiting?
it = JavaScript code
That's true the "StandardFirmata" sketch will be persisted when the Arduino resets. I've got a node script that connects to the Arduino via firmata protocol that looks something like:
var five = require("johnny-five");
var board = new five.Board();
// The board's pins will not be accessible until
// the board has reported that it is ready
board.on("ready", function() {
console.log("Ready!");
var led = new five.Led(13);
led.blink(2000);
});
I was hoping I could make this JavaScript run without first connecting the Arduino board via USB and running my node script.