I've been experimenting with phidgets for a project of mine.
However, I run into a problem. For this project to work I need to have a Touch Keypad Phidget and a PhidgetRFID Read-Write plugged in at the same.
The idea being to link a code that would be inputed by the touch keypad to a RFID tag.
The rough code for the touch keypad I came up with worked, here it is:
Code: Select all
@Override
public void openComs() {
try {
addListeners();
zeroButton.open(5000);
oneButton.open(5000);
twoButton.open(5000);
threeButton.open(5000);
fourButton.open(5000);
fiveButton.open(5000);
sixButton.open(5000);
} catch (PhidgetException ex){
System.err.println(ex.getMessage());
}
}
private void addListeners() {
zeroButton.addTouchListener((cl) -> {
inputBuffer.add(0);
checkCallback();
});
oneButton.addTouchListener((cl) -> {
inputBuffer.add(1);
checkCallback();
});
twoButton.addTouchListener((cl) -> {
inputBuffer.add(2);
checkCallback();
});
threeButton.addTouchListener((cl) -> {
inputBuffer.add(3);
checkCallback();
});
fourButton.addTouchListener((cl) -> {
inputBuffer.add(4);
checkCallback();
});
fiveButton.addTouchListener((cl) -> {
inputBuffer.add(5);
checkCallback();
});
sixButton.addTouchListener((cl) -> {
inputBuffer.add(6);
checkCallback();
});
}
Code: Select all
@Override
public void openComs() {
try{
rfidReader.addTagListener((e)->{
parent.onRFIDReadCallback(e.getProtocol(), e.getTag());
});
rfidReader.open(5000);
}catch (PhidgetException ex){
System.err.println(ex.getMessage());
}
}
Is this a known issue and if so could you point me in the right direction, it would be really appreciated.
Have a nice day
PS:
I've already tried to change the RFID reader as well as the touch keypad. It doesn't change anything.