You need to create a separate DigitalOutput object for each channel you want to have open. So, you could do something like this:
Code: Select all
sensor0 = new jPhidget22.DigitalOutput();
sensor1 = new jPhidget22.DigitalOutput();
sensor0.setDeviceSerialNumber(389142);
sensor1.setDeviceSerialNumber(389142);
sensor0.setChannel(0);
sensor1.setChannel(1);
Of course, this will get tedious quickly if you want to do it for all 64 channels, so you might want to use an array and a loop instead:
Code: Select all
var leds = [];
for(i = 0; i < 64; i++) {
ch = new jPhidget22.DigitalOutput();
ch.setDeviceSerialNumber(389142);
ch.setChannel(i);
leds.push(ch);
}
From then on you can access the digital output with leds
. You'll have to create a similar for loop when you open, close, or set any property that you want on all 64 outputs.