@tibbo-tps/tibbit-41
v0.0.2
Published
Tibbit #41 (8-bit Port)
Downloads
2
Readme
Tibbit #41 (8-bit Port)
The node module for Tibbit #41 (8-bit Port).
Installation Instructions
The module is available as precompiled binary and C source code.
Install the module
npm install @tibbo-tps/tibbit-41
Usage
var extender = require("@tibbo-tps/tibbit-41").init(socket);
API Methods:
init(socket)
- socked - TPP socket number
Returns an object with the following methods:
.setupPin(pin, direction, pullup)
- pin - pin number, 1..8
- direction - true for input, false for output
- pullup - true to enable, false to disable
.setValue(pin, value)
- pin - pin number, 1..8
- value - true for HIGH, false for LOW
.getData(pin)
- pin - pin number, 1..8
Returns an object with the following properties:
- pullup
- direction
- value
Example:
var extender = require("./tibbit41.js").init("S15");
var pinsList = [1,2,3,4,5,6,7,8];
pinsList.forEach(function(pin){
extender.setupPin(pin, false, true);
});
pinsList.forEach(function(pin){
extender.setValue(pin, true);
});
pinsList.forEach(function(pin){
console.log(extender.getData(pin));
});
About the Tibbit #41 block
This Tibbit is based on the MCP23008 8-bit port expander IC from Microchip. Refer to Microchip datasheet for operation details.
This C1 device requires the Tibbit #00-3 to be installed in the neighboring "M" Tibbit socket.
To simplify wiring, Tibbit #41 is supplied with a 200mm WAS-P044 cable.