Main Site Documentation

KeyPad test strangeness


#1

So I just happen to have one of the keypads you just added to the store lying around (what are the odds of that?) and was psyched to give the tutorial code a try. Everything behaved as expected with one exception. P9 on socket 9 did not work. When any of the third column of keys was pressed, ReadMatrix() returned false. I went through a bunch of troubleshooting to make sure my keypad was good, extender well soldered, etc… only when I switched to socket 6 did all keys work as expected.

The only other thing plugged into the Spider is the display, which is not used. The code is verbatim from the tutorial, other than the socket number change.

Can somebody smarter than me explain why this might be?


#2

The code on the wiki is was a quick test so it is very possible that there is an issue. We will look into it later or if you find the fix then please feel free to update the wiki.


#3

The code seems fine (see edit). I was wondering why changing the socket would make a difference.

[edit] As noted in the code comments, I get a lot of keypressed events for “one” press, but that’s no big deal to clean up. This example code is continuously polling the keys, so the longer you hold down the key, the more events you get. Using the KeyUp event is more reliable because only one fires per key press.


#4

I thinking the same thing :slight_smile: It shouldn’t!


#5

I apologize for reopening this thread after so long!

I have the 3x4 keypad and am attempting to run the test code. Although I’ve added the Glide.dll file to the References, it is complaining that ‘hardware’ does not exist in the namespace. If I comment out that line of code, it simply complains that there is no definition for ‘ProgramStarted’. Do you remember if you had to make any changes to the test code to make it run?

I am wondering if my problem could be where I have the modules plugged in as the Visual Studio designer automatically puts in a connection for the extender module in slot 14 on the Spider board but it appears that the Display needs to be plugged in but now that port is already in use.

I am attempting to write a simple bit of code that will print the number of the button that has been pressed so I was going to use the test code as a start to understand how the pins work!


#6

What test code are you referring to?


#7

The tutorial provided on the product page: http://wiki.tinyclr.com/index.php?title=Gadgeteer_Keypad


#8
  1. Start with clean application and connect display only through Designer.

  2. Add glide and your UI code make sure everything compiles and runs.

  3. Add keypad test code you can use same socket 9 as in the example,so there will be no issue with display on socket 14.


#9

Thank you for your help, Architect! I’ve got it working now, so time to start trying to clean up the code as ransomhall described :slight_smile: