Code: Select all
var phidget22 = require('phidget22');
function runExample() {
var digitalInput0 = new phidget22.DigitalInput();
digitalInput0.setIsHubPortDevice(true);
digitalInput0.setHubPort(0);
digitalInput0.onStateChange = function onDigitalInput0_StateChange(state) {
console.log('State: ' + state.toString())
};
digitalInput0.open(5000).then(function() {
setTimeout(function () {
digitalInput0.close();
process.exit(0);
}, 5000);
});
}
var conn = new phidget22.Connection(5661, '192.168.3.113');
conn.connect().then(runExample);
Users browsing this forum: No registered users and 1 guest