wvmarle:
Open the Serial monitor (ctrl-shift-M) to see the messages printed to Serial, and make sure it's set to the same baudrate as the Serial.begin() command dictates.How about the pull-up resistor? Without it, it won't work ever.
OK, I'll try that with the serial monitor. I have a pull-up resistor on my breadboard. So that should not be the problem.