How inputs really work?

Try this to start - use the pin called SWITCH1 as the Column, and SWT-GNDx as the the 4 row pins.

Hmm... I tried both options (Grounds as columns and rows), but getKey() seems to be floating, since it always returns 0 and 1.

You shouldn't be grounding anything. Column goes to arduino pin, and the 4 rows go to other pins.
www.crossroadsfencing.com/SimpleRemote.pdf
You'd have just the 1 column and the 4 rows.

Sorry, poor choice of words on my part.

I meant the 4 button pins. They're labeled ground on the board, but they are in fact plugged into pins.

Thanks for the diagram. So I should have the all button pins tied to Arduino pins, and turn on the pullup resistors on the SWT-GNDx pins? Or should I use externals?

Use the internals, tho I don't think it makes a difference. I don't have any installed at all. I didn't do anything to declare them as inputs or outputs, only define them prior to void setup() per the keypad demo with my other keys added and defined,see below. I am pretty sure the library code takes care of the rest of it.

#include <Keypad.h>

const byte ROWS = 4; // Four rows
const byte COLS = 4; // Four columns

// Define the Keymap
char keys[ROWS][COLS] = 
{
  { '1','2','3','A'           }  ,  // row 1
  { '4','5','6','B'           }  ,  // row 2
  { '7','8','9','C'           }  ,  // row 3
  { '*','0','#','D'           }  ,  // row 4
};
// Connect keypad ROW1, ROW2, ROW3 and ROW4 to these Arduino pins.
byte rowPins[ROWS] = { 6, 5, 4, 3 };  
// Connect keypad COL1, COL2, COL3, COL4 to these Arduino pins.
byte colPins[COLS] = {  10, 9, 8, 7 }; 

// Create the Keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

Well dang, I just soldered pull down resistors on the buttons yesterday. I'll disconnect them from ground tomorrow and see if I can get the keypad library working.

The library definitely helps keep the code simple, thanks for the help.

I hope I'm not completely hijacking and changing the topic here, but how would I get the Arduino to read a button press faster? My configuration (4 10k pull down resistors and a common 5v line) is slow, and takes 1-6 seconds to reach a readable HIGH input.

Really? Mine has no pulldowns, just the diodes to make a Wired AND signal for the hardware interrupt, response is immediate.
I show resistors here, but didn't actually use them.
The diodes were LEDs I had around, get a very little flash with a keypress.

So the buttons are active LOW, then (seeing that the Interrupt defaults to HIGH)?

I hadn't thought of using hardware interrupts. It's not needed for my application (Simon), but it could be useful for changing settings mid-game, etc.

I'll have to experiment with it once I get new supplies.

and takes 1-6 seconds to reach a readable HIGH input.

Then you have something seriously wrong with your circuit or component values.

Huh. I bought a new PCB and reconnected all the wires. Works perfectly.

Thanks for all the help!

You think something happpened to the uC board then? I fried my first one, replaced the 28 pin DIP with a new one to get back in business.
Fried a Pro-Mini recently too, once I buy a replacement chip I'm going to try reprogramming via bit-bang via this method:
http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html

I'm not sure what it was. I didn't replace the uC, but I have worn it out with soldering and desoldering. I thought I might have accidentally shorted some pins, but it seems to be fine. I might have had a bad solder joint. This time, I soldered female headers to the PCB and just plugged in the wires from the uC.

Can't you just buy a ATMega with the bootloader already on it? I guess that wouldn't be as fun though.

You can, but I haven't seen the surface mount parts anywhere. I did buy a couple preprogrammed DIP parts after I killed the first one, still have 1 spare from that. I found the bit-bang article after that, so I bought a couple of blank DIP parts, but haven't tried programming.
Next time I order stuff from Mouser or from Sparkfun, whoever comes first, I will order a couple blank surface mount parts also.
Here's a couple pictures of my remote control, I just finished rebuilding it.


Xmits on 434 MHz with sparkfun module
3.3V ProMini running on 3.7V LiIon battery, 8 MHz
(had to change code to double Serial.Begin speed and the VirtualWire bits/sec speed to account for that)
16 key keypad from Velleman
Box is 0.2L Really Useful Box (found at Staples) (edit: correct size)
Parts are installed on wirewrap strips I got from Gravitech
ProMini is installed with Interconnects from Gravitech (0.018 diameter pins on bottom to go in wirewrap socket, 0.025 diameter on top soldered to the Promini)
Empty socket space is for MAX1811 Li Ion battery charger and some Rs & Cs for that - need to decide on a panel mount connecter for bringing in +5V power or power from USB.

Is drawing 0.98mA in idle mode, about 10mA when a key is pressed. Should be able to go a month+ between chargings.

That's awesome! I bought a keypad just for the heck of it, so I'll have to try something like this.

Two questions: what are the empty sockets for, and what IR LED (if you used one) did you use?

Xmits on 434 MHz with sparkfun module - RF, not IR.

Empty socket space is for MAX1811 Li Ion battery charger and some Rs & Cs for that - need to decide on a panel mount connecter for bringing in +5V power or power from USB.

Gonna go check out Duracell Power Grid at Target/Walmart.

Or maybe not - just saw their online prices. $65 for the charging pad & 1 power receiver, additional receivers are $35. So I'm leaning towards $2.50 for a USB to 2.1mm power cord and $1.39 for the panel mount jack that only needs a circulart hole for mounting.

RF? What are you controlling?

Mini-USB definitely seems like it would be the best choice, since you could charge it with any computer, car/wall outlet, etc.

I am controlling a fencing scoring machine. Runs time, keeps score, displays warning & penatly status, shows when touches are scored, etc. Right now is using MAX6951 to control multipexing of the digits with decimal points used also.

![](http://www.crossroadsfencing.com/Finals Box.jpg)

Ran pretty well for several hours last night, only I think the chip died on me, digitis are all goofy this morning. Put a second one in, is even worse. Looking at other choices now (parts with more pins and more conventional mutliplexing schemes, back to common cathode as chip select kind of thing).

You would think miniUSB would be nice - but the panel mounts are a pain to install (after having done several 9-pin D-sub connectors). The one I have found are these releatively big things, need square openings along with screw holes. With a 2.1mm jack just 1 round hole is needed screw on the outer ring & you're done. Only hassle is needing a cable with 2.1mm plug on the end.

That's really impressive. I guess a 2.1 mm jack would be a simpler solution then. It would probably be easier to plug in to charge as well. If you were to use miniUSB, could you split the connector to charge the battery and program the Pro Mini? That would be really cool.

I don't think so - need the FTDI chip to be able to program, pro mini can't talk to PC without it.
could charge tho it wired for it.