Wemos D1 mini/ ESP8266 have problem in serial monitor output

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] = {

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() {

void loop() {
  char key = keypad.getKey();

  if (key){

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

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

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.