> ## Content Index
> Fetch the complete content index at: https://www.mrstebo.co.uk/llms.txt
> Use this file to discover other available public pages before exploring further.

# FEZ Panda II with Matrix Keypad
- URL: https://www.mrstebo.co.uk/fez-panda-ii-with-matrix-keypad/
- Published: 2014-05-11T23:00:00.000Z
- Updated: 2023-05-15T23:43:03.000Z
- Author: Steven Atkinson
- Tags: C Sharp Programming, Dotnet, Software Architecture, Software Development, Embedded Systems

After a few days of attempting to get this to work I thought I would save some time for anyone else attempting this particular activity.

I am using the [JM09K keypad](http://www.rapidonline.com/electronic-components/data-entry-keypad-73486/?ref=mrstebo.co.uk) that I bought quite a while ago.

I am also using the [FEZ Panda II](https://www.ghielectronics.com/catalog/product/256?ref=mrstebo.co.uk)

**A link to the source code is at the bottom of this article*

# Where to start?

I was looking at a lot of different projects and it seemed that some people were using external pull-up resistors. But I was sure I wouldn’t need any of those! I saw that Arduino and Raspberry Pi projects had just stuck a header on the keypad and stuck it right in to the dev board. Turns out that it works a treat!

So I looked at the [Arduino Keypad library](http://playground.arduino.cc/code/Keypad?ref=mrstebo.co.uk) and found that you needed to change the column pins from output to input. At first I thought that I would not be able to do that, but it turns out that the Port class implements ****IDisposable**! So we can just wrap the Port declarations inside a using statement which will dispose of the pin reservation after we have finished using it.

# The Keypad class

Influenced by the Arduino Keypad libraries use of a Keymap I decided that I would try and mimic some of its behaviour.

We use the `HoldTime` to allow for a delay between key scans.

Now lets have a look at the method we use for getting the keys (I am sure I could refactor it to look a bit nicer though!).

Simple enough, right!

# Now lets use it in our main program!

The source code for this article is available [here](https://github.com/mrstebo/NETMF-Matrix-Keypad?ref=mrstebo.co.uk)

**You need to have the .NET Micro Framework 4.1 installed so you can get access to the* ****FEZPanda\_II\_GHIElectronics.NETMF.FEZ*** *library.*