Skip to content

Latest commit

 

History

History
101 lines (57 loc) · 1.8 KB

imp-io.md

File metadata and controls

101 lines (57 loc) · 1.8 KB

Led Blink on Electric Imp

Example using Johnny-Five + imp-io to control an Electric Imp.

LED on pin 9

docs/breadboard/imp-led.png

Fritzing diagram: docs/breadboard/imp-led.fzz

 

Run this example from the command line with:

node eg/imp-io.js
var five = require("johnny-five");
var Imp = require("imp-io");

var board = new five.Board({
  io: new Imp({
    agent: process.env.IMP_AGENT_ID
  })
});

board.on("ready", function() {
  var led = new five.Led(9);
  led.blink();
});

Illustrations / Photos

Electric Imp

docs/images/imp.jpg

Additional Notes

To communicate with an Electric Imp using Johnny-Five w/ Imp-IO, you will need to upload the special Tyrion agent and device firmware through Electric Imp's IDE. We recommend you review Electric Imp's Getting Started before continuing. Store your agent ID in a dot file so it can be accessed as a property of process.env. Create a file in your home directory called .imprc that contains:

export IMP_AGENT_ID="your agent id"

Then add the following to your dot-rc file of choice:

source ~/.imprc

Learn More

 

License

Copyright (c) 2012-2014 Rick Waldron [email protected] Licensed under the MIT license. Copyright (c) 2015-2023 The Johnny-Five Contributors Licensed under the MIT license.