The Netduino forums have been replaced by new forums at community.wildernesslabs.co.
This site has been preserved for archival purposes only
and the ability to make new accounts or posts has been turned off.
I recently purchased the Electronic Brick Starter kit for use on my Netduino Plus board. Loving the experience so far . I also purchased the Keypad Module (BUS) http://proto-pic.co....pad-module-bus/ not realising that this is a discontinued product
I have tried to work out how this interfaces with the Netduino and have had limited success in getting an output that I can understand. I have searched the internet, the forum and WIKI but cannot find any information on how this board works with any Arduino board.
Does anybody have any information available that you are able to point me towards?
Thanks,
Mike
it is an easy task to translate this code from the Arduino C++ Variant to C# or VB
It would be useful to know the pin outs on the IDC connector they have attached to the board so you know which pins connect to the 3 ports that are outputs and which should be connected to the inputs.
If you are having problem drop me a PM or ask further here and I can do the translation for you. But it is best to try yourself first.
Cheers Pete.
I was going to change the world, then I discovered Netduino.
The world will have to wait.
Hi Both,
I have tried your code Stefan but it's not worked I have also tried a simple app that just lists pin values for the conected pins:
public static void Main()
{
TristatePort d2 = new TristatePort(Pins.GPIO_PIN_D2, false, false, Port.ResistorMode.PullUp);
TristatePort d3 = new TristatePort(Pins.GPIO_PIN_D3, false, false, Port.ResistorMode.PullUp);
TristatePort d4 = new TristatePort(Pins.GPIO_PIN_D4, false, false, Port.ResistorMode.PullUp);
TristatePort d5 = new TristatePort(Pins.GPIO_PIN_D5, false, false, Port.ResistorMode.PullUp);
TristatePort d6 = new TristatePort(Pins.GPIO_PIN_D6, false, false, Port.ResistorMode.PullUp);
TristatePort d7 = new TristatePort(Pins.GPIO_PIN_D7, false, false, Port.ResistorMode.PullUp);
TristatePort d8 = new TristatePort(Pins.GPIO_PIN_D8, false, false, Port.ResistorMode.PullUp);
TristatePort d9 = new TristatePort(Pins.GPIO_PIN_D9, false, false, Port.ResistorMode.PullUp);
while (true)
{
Debug.Print(
" d2: " + d2.Read().ToString()
+ " d3: " + d3.Read().ToString()
+ " d4: " + d4.Read().ToString()
+ " d5: " + d5.Read().ToString()
+ " d6: " + d6.Read().ToString()
+ " d7: " + d7.Read().ToString()
+ " d8: " + d8.Read().ToString()
+ " d9: " + d9.Read().ToString()
);
}
}
With this I only get changes in D5, D6 and D7 for the rows but none of the other pins show a change. Could it be that I have not set up the pins correctly in code?
Have you configured the pins correctly? The class is generic for matrix keypads, but the pins can be different with your keypad.
I have also tried a simple app that just lists pin values for the conected pins:
You've got them all just reading a value, but that's not how it works. Look at the diagram on the link I provided. A signal is sent from an output port to an input port. Rows are input ports, columns are output ports (or the other way around, doesn't matter).
Nope can't find any documentation anywhere If I did I would know how to feed Stefan's code above with teh right pins. Looks like it's a case of try different combinations ntil it works.
Using the electronic brick it maps pins to ports for you but without docs I have to guess where.
Mike, if you have any multimeter, switch it as "Ohms", then try the various combinations of pins. When a key is pressed only a row and a column should give a low value of resistance (under an hundred of Ohms).
Hope it helps.
Cheers
Biggest fault of Netduino? It runs by electricity.
Arrghgg this is frustrating looks like a multimeter is in order (and there was me thinking a component based kit would make life easier).
Trying this (and combinations of the pins in different orders + swapping the rows for the columns):
// Row pins. The keypad exists out of 4 rows.
Cpu.Pin[] RowPins = { Pins.GPIO_PIN_D2, Pins.GPIO_PIN_D3, Pins.GPIO_PIN_D4 };
// Col pins. The keypad exists out of 3 columns.
Cpu.Pin[] ColPins = { Pins.GPIO_PIN_D5, Pins.GPIO_PIN_D6, Pins.GPIO_PIN_D7 };
The best results I get are:
Top Row:
Key pressed: 6
Key released: 6
Key pressed: 6
Key released: 6
Key pressed: 6
Key released: 6
Middle Row:
Key pressed: 7
Key released: 7
Key pressed: 7
Key released: 7
Key pressed: 7
Key released: 7
Key pressed: 7
Key released: 7
Bottom Row:
Key pressed: 8
Key released: 8
Key pressed: 8
Key released: 8
Key pressed: 8
Key released: 8
Key pressed: 8
Key released: 8