You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Imp-io is a Firmata-compatibility IO class for writing node programs that interact with Electric Imp devices. Imp-io was built at Bocoup
Getting Started
To communicate with an Electric Imp using Johnny-Five w/ Imp-IO, you will need to upload the special
Tyrionagent and device firmware through Electric Imp's IDE. We recommend you review Electric Imp's Getting Started before continuing.
Tyrion Setup
Follow Electric Imp's Getting Started instructions to set up a wifi connection to your Electric Imp device.
Once your Imp is setup, open the IDE (familiarize yourself here) and click Create New Model, give it a name and assign it to your device.
Paste the contents of agent.nut into the Agent pane and device.nut into the Device pane:
Expand the Active Model in the column on the left by click on the rightward arrow. The model will appear below, click on the model.
Click Build and Run to finish preparing your Electric Imp.
Imp-IO Setup
In the Electric Imp IDE, locate and copy the agent id, located in agent url Look for the agent id located in the agent url:
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
Blink an Led
The "Hello World" of microcontroller programming:
varImp=require("imp-io");varboard=newImp({agent: process.env.IMP_AGENT_ID});board.on("ready",function(){console.log("CONNECTED");this.pinMode(9,this.MODES.OUTPUT);varbyte=0;// This will "blink" the on board ledsetInterval(function(){this.digitalWrite(9,(byte^=1));}.bind(this),1000);});