Hello.
I have a problem with my nodemcu 3.0 esp8266 and my keypad. For some reason, the last cable does not work. 3 and # are incorrect, and the 3 blocks the whole pressing unless I press 1 or 2 again.
1
2
1
2
4
5
6
7
7
8
9
0
3 and # are also mixed with 1 and *
/* @file HelloKeypad.pde
|| @version 1.0
|| @author Alexander Brevig
|| @contact alexanderbrevig@gmail.com
||
|| @description
|| | Demonstrates the simplest use of the matrix Keypad library.
|| #
*/
#include <Keypad.h>
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] = {D0, D3, D4, D5}; // ESP8266 pins connect to the row pins
byte colPins[COLS] = {D6, D7, D8}; // ESP8266 pins connect to the column pins
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
void setup(){
Serial.begin(9600);
}
void loop(){
char key = keypad.getKey();
if (key){
Serial.println(key);
}
}
The keypad is Whadda WPI300
R1 connects to D0,
R2 connects to D3
R3 connects to D4
R4 connects to D5
C1 connects to D6
C2 connects to D7
C3 connects to D8
One thing I noticed is that always the last cable does not work properly. If I put C3 on C2, the last cable is C2 in D8 doesn't work. I also can switch around the pin from D8 to S2 and will work and have the same issue. I tried manually to put the GPIO pins and still the same issue.