Hi
does anybody ever had problems using Keypad.h library and a simple led blinking program?
In my case if i
- connect a Matrix kepad (0-9; * #) to arduino (UNO) Pin 2-8
- include and use the library
- 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