It's 2:30AM and I've had entirely too much coffee.

I got an Uno and I'm having a blast with it. It works on Linux... with Emacs + make. Hallalujah!
I have a (guitar pedal related) project I'd like to implement, but I have to learn how microcontrollers work first. It's loosely described here:
http://www.diystompboxes.com/smfforum/index.php?topic=101045.0My project will require 16 push buttons. So I've been reading all I can find on the topic (shift registers, debouncing, etc.).
Here is some code I came up with. A 7 segment display is incremented once, when -- and only when -- the button transitions from released to pressed. I don't really have a specific question. I'd just like know if I'm headed in the right direction.
/*
Increment a 7 segment display once per button press.
Written for Arduino Uno Rev 3.
Uno pins 0-6 are segments a-g respectively.
Pin 8 is the button input.
7 segment display is common cathode.
Button down is 0v, up is 5v;
*/
/******************************************
NOTE: Unhook pin 0 and 1 before uploading
*********************************************/
const int but = 8;
const byte segMap[] = {
0x3F, /* 0 */
0x06, /* 1 */
0x5B, /* 2 */
0x4F, /* 3 */
0x66, /* 4 */
0x6D, /* 5 */
0x7D, /* 6 */
0x07, /* 7 */
0x7F, /* 8 */
0x6F, /* 9 */
0x77, /* A */
0x7C, /* B */
0x39, /* C */
0x5E, /* D */
0x79, /* E */
0x71, /* F */
};
int butPressed();
void increment();
void setup() {
DDRD = 0x7f; /* set pin 0-6 output */
pinMode(but, INPUT);
PORTD = segMap[0]; /* initialize display to 0 */
}
void loop() {
if (butPressed())
increment();
}
/*
Increment the display once per call.
Start at 0 (initialized in setup()). After F is displayed, start over.
*/
void increment() {
static int n = 1;
PORTD = segMap[n];
n = ++n % 16;
}
/*
Return 1 only if the button has transitioned from released to pressed.
Return 0 otherwise.
*/
int butPressed() {
static int oldVal = 1;
int val = 0, ret = 0;
for (int i=0; i!=3; ++i) {
val = digitalRead(but);
delay(10);
}
ret = (oldVal && !val);
oldVal = val;
return ret;
}