@rwaldron There are two things I would like to add to imp-io but they are not things found/done in Firmata. I think they are important given the nature of how the Imp works.
Both of this things are easily done, but for the second I need to add a command. What is the authoritative source for this list and can I add new ones?
const PIN_MODE = 0xF4;
const ANALOG_WRITE = 0xE0;
const SERVO_WRITE = 0xE1;
const DIGITAL_WRITE = 0x90;
const REPORT_ANALOG = 0xC0;
const REPORT_DIGITAL = 0xD0;
const I2C_REQUEST = 0x76;
const I2C_REPLY = 0x77;
const I2C_CONFIG = 0x78;
const SYSTEM_RESET = 0xFF;
HCSR04
with a electric imp?TypeError: this.io.pingRead is not a function
'use strict';
const five = require("johnny-five");
const Imp = require("imp-io");
const board = new five.Board({
io: new Imp({
agent: process.env.IMP_AGENT_ID
})
});
board.on("ready", function() {
let proximity = new five.Proximity({
controller: "HCSR04",
pin: 7
});
proximity.on("data", function() {
console.log("Proximity: ");
console.log(" cm : ", this.cm);
console.log(" in : ", this.in);
console.log("-----------------");
});
proximity.on("change", function() {
console.log("The obstruction has moved.");
});
});
Hey room... newb here. New to gitter and imp-io. Looking for some help with my Imp-io setup. My node app is crashing if my imp is not on and connectable. Is there something I'm missing here? Even when I use a try{} catch(e){} it still crashed my server.
Would like to be able to have it simply return an error I can log out.
Anyone know what to do here?
try{
var board = new five.Board({
io: new Imp({
agent: "############"
})
});
board.on("ready", function() {
var led = new five.Led(1);
led.blink(1000);
});
}
catch(e){
console.log("Can't connect to Imp")
}