when i use wemos D1 mini with 4x4 keypad. when I press the A button The output in serial monitor is 1, and if i press B the output is 4. for other buttons ok, no problem.
please help me anyone.
The code is:
#include <Keypad.h>
const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns
char keys[ROWS][COLS] = {
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};
byte rowPins[ROWS] = {D1, D2, D3, D4};
byte colPins[COLS] = {D5, D6, D7, D8};
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);
}
}
myoui_hirota:
The code is:
Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'
Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination
See also FAQ - Arduino Forum for general rules on forum behaviour and etiquette.
Hello,
Welcome to the Arduino Forum.
This guide explains how to get the best out of this forum. Please read and follow the instructions below.
Being new here you might think this is having rules for the sake of rules, but that is not the case. If you don’t follow the guidelines all that happens is there is a long exchange of posts while we try to get you to tell us what we need in order to help you, which is fru…
1 Like
I am new here, thanks for your information.
Hi @myoui_hirota .
The D8 pin used by the " A B C D " column is actually the GPIO15.
This GPIO15 on Wemos Mini has a 10KOhm resistor for Gnd.
This affects the scanning done by the Keypad.h library.
Change the connection from D8 (GPIO15) to DO(GPIO16) and you will see that it works correctly.
RV mineirin
1 Like
thans buddy. you helped me
system
Closed
May 4, 2022, 4:24am
6
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.