Hello,
I have a problem with the input port.
So far I’ve run a keypad with the FEZ Spider Board, which also works very well.
Now I want to connect the keypad andem NanoBoard Sytech. It’s not a GHI board, but still Gadgeteer compatible. I use a socket with 7 GPIO as in Spider Board. However, always with an ArgumentException is thrown. I point to the ResistorMode, the error message is gone. Nevertheless, it does not work. The GPIOs can also set different?
Here a snipet of the Code:
public Keypad(int sockelKeypad)
{
try
{
// set up our pins
Cpu.Pin P3 = GT.Socket.GetSocket(sockelKeypad, false, null, null).CpuPins[3];
Cpu.Pin P4 = GT.Socket.GetSocket(sockelKeypad, false, null, null).CpuPins[4];
Cpu.Pin P5 = GT.Socket.GetSocket(sockelKeypad, false, null, null).CpuPins[5];
Cpu.Pin P6 = GT.Socket.GetSocket(sockelKeypad, false, null, null).CpuPins[6];
Cpu.Pin P7 = GT.Socket.GetSocket(sockelKeypad, false, null, null).CpuPins[9];
Cpu.Pin P8 = GT.Socket.GetSocket(sockelKeypad, false, null, null).CpuPins[8];
Cpu.Pin P9 = GT.Socket.GetSocket(sockelKeypad, false, null, null).CpuPins[7];
// set up our matrix
Rows[0] = new OutputPort(P3, false);
Rows[1] = new OutputPort(P4, false);
Rows[2] = new OutputPort(P5, false);
Rows[3] = new OutputPort(P6, false);
Columns[0] = new InputPort(P7, false, Port.ResistorMode.PullDown);
Columns[1] = new InputPort(P8, false, Port.ResistorMode.PullDown);
Columns[2] = new InputPort(P9, false, Port.ResistorMode.PullDown);
}
catch (ArgumentException e)
{
Debug.Print("Meldung: " + e.Message);
}
}