Olimex Support Forum

Microcontrollers => ESP32 => Topic started by: enschy on March 21, 2021, 02:01:40 PM

Title: ESP32 POE ISO Keypad
Post by: enschy on March 21, 2021, 02:01:40 PM
Hello,
has somebody connected a 3x4 Keypad to the esp32_poe_iso board? I`ll tried many gpio´s. Nothing happend.

Keypad: https://www.sparkfun.com/products/14662

Thanks
Title: Re: ESP32 POE ISO Keypad
Post by: LubOlimex on March 22, 2021, 08:52:38 AM
Probably share which 7 GPIO pins do you use and also share the code you are using.
Title: Re: ESP32 POE ISO Keypad
Post by: enschy on March 22, 2021, 06:51:08 PM
Here`s my test code:

#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] = {2, 3, 13, 14};
byte colPins[COLS] = {15, 32, 33};

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);
  }
}

I tested GPIOs: 2, 3, 13, 14, 15, 32, 33

Thanks
Title: Re: ESP32 POE ISO Keypad
Post by: LubOlimex on March 23, 2021, 08:42:50 AM
Do not use GPIO3, it goes to the CH340T.

GPIO2, GPIO14, GPIO15 are free to use if you don't have SD card. So make sure there is no SD card inserted.

Did you install the library required for the code?

Maybe for initial testing connect just 2 wires instead of all 7 (one for row and one for column, for example) and check only that button.

What do you select in Arduino IDE, do you see ESP32-POE-ISO in board selector?

Can you try with some other library, there seems to be a lot of libraries online for 4x3 keypads, like this one: https://lastminuteengineers.com/arduino-keypad-tutorial/ ?

Title: Re: ESP32 POE ISO Keypad
Post by: enschy on March 23, 2021, 08:58:12 PM
Now i have used GPIO14 and 15 for row1 and col1, nothing. SDcard not insert. I have now tested like this example https://lastminuteengineers.com/arduino-keypad-tutorial/ same result. Also i have tested 14 and 15 with simple switch input (need Pulldown resistor) -> works and simple output -> works
At last i have tested your Example:
https://github.com/OLIMEX/ESP32-POE/tree/master/SOFTWARE/ESP-IDF/ESP32_PoE_Ethernet_IDFv4.0
Works out of the box.

I think the better way is to use i2c:
https://github.com/RobTillaart/I2CKeyPad
Thanks
Title: Re: ESP32 POE ISO Keypad
Post by: LubOlimex on March 24, 2021, 09:56:21 AM
Interesting. Hmmm, a lot of things work, so probably something related to the library or the keypad.