Keypad.h not working

Hi

does anybody ever had problems using Keypad.h library and a simple led blinking program?
In my case if i

  1. connect a Matrix kepad (0-9; * #) to arduino (UNO) Pin 2-8
  2. include and use the library
  3. I'm not able to blink a simple led on pin9 (If comment call library line, everything works)

here the code

#include <Keypad.h> //when I comment this line (and other reference) led start blinking !

const byte ROWS = 4; //four rows
const byte COLS = 3; //three columns
char keys[ROWS][COLS] = {
  {'1','2','3'},
  {'4','5','6'},
  {'7','8','9'},
  {'*','0','#'}
};
byte rowPins[ROWS] = {8, 7, 6, 5}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {4, 3, 2}; //connect to the column pinouts of the keypad

// Create the Keypad
Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
 
  This example code is in the public domain.
 */

void setup() {                
  // initialize the digital pin as an output.
  // Pin 13 has an LED connected on most Arduino boards:
  pinMode(9, OUTPUT);     
}

void loop() {
  digitalWrite(9, HIGH);   // set the LED on
  delay(1000);              // wait for a second
  digitalWrite(9, LOW);    // set the LED off
  delay(1000);              // wait for a second
}

thanks all

MatteoBeginner:
Hi

does anybody ever had problems using Keypad.h library and a simple led blinking program?

It's my fault. I was just told about the bug yesterday and I was going to update the library tonight. You got to it before I did.

I just uploaded a new patch for the library. It's only been tested once so I can only hope that I haven't introduced any new bugs. However, if you would like to completely avoid the issue you can upgrade your Arduino software to 1.0.4 from the main site download page http://arduino.cc/en/Main/Software.

Let me know if you have any more problems. My email is in the library files.

Thanks

everythings seems OK using IDE 1.0.4
Now I can go on try to integrate with 3G/GPS shield for Arduino (by Cooking Hacks)

:slight_smile: