
Provides an interface for Dallas DS2413 IO modules over the DS2482 onewire bridge
$ npm install ds2482-io
var DS2413 = require('ds2482-io');
var io = new DS2413();
io.init(function(err) {
if (err) { throw err; }
io.search(function(err, modules) {
if (err) { throw err; }
modules.forEach(function(module) {
module.write({PIOA: true}, function(err, resp) {
if (err) { throw err; }
console.log(resp); // Returns the status of each module
});
});
});
});Creates an interface for Dallas DS2413 IO modules
options.wirean instance of wire
Creates an io module instance
romthe ROM address of the module as a 16 character hex encoded stringoptions.wirean instance of wire
Resets the bridge chip and any onewire devices connected to it
Searches the bus and returns a list of found io modules
[
<Module "3ae9f412000000a6">
]Reads the current pin and latch state status of the module
{
PIOA: {pin: false, latch: false},
PIOB: {pin: false, latch: false}
}Writes the latch state to the module and returns the current status
state.PIOAa flag to enable the output latch state of pin Astate.PIOBa flag to enable the output latch state of pin B
{
PIOA: {pin: true, latch: true},
PIOB: {pin: false, latch: false}
}