sensor_vn used as GPIO39 input

Francis
Posts: 4
Joined: Mon Jan 11, 2021 1:35 pm

sensor_vn used as GPIO39 input

Postby Francis » Wed Jan 13, 2021 4:21 pm

Hello,

I am trying to connect a 3x4 keyboard using Keypad.h library example.

I wish to use GPIO 26, 25, 33, 32, 35, 34, 39 as input.

I put 10k pull-up resistors for GPIO 35, 34 and 39.

I have to use code as follow:

Code: Select all

byte rowPins[ROWS] = {R1, R2, R3, R4};
byte colPins[COLS] = {C1, C2, C3};
Case 1 works:

Code: Select all

byte rowPins[ROWS] = {26, 34, 35, 33};
byte colPins[COLS] = {25, 27, 32};
Case 2 does not work:

Code: Select all

byte rowPins[ROWS] = {25, 39, 34, 32};
byte colPins[COLS] = {33, 26, 35};
In case 2, nothing happens when I press keys of column 3.

The problem should come from GPIO35. But why is it working in case 1?

So maybe the problem comes from the use of GPIO39?
Am I using the right pull-up for GPIO39?
Has it something to do with the capacitor of GPIO39?
The use of GPIO39 disables GPIO35?

Thank you for your help!

Francis

boarchuz
Posts: 566
Joined: Tue Aug 21, 2018 5:28 am

Re: sensor_vn used as GPIO39 input

Postby boarchuz » Wed Jan 13, 2021 6:33 pm

Keypads like this work by toggling column pins output low sequentially, reading the state of each row pin for each column.

In case 2, GPIO 35 is used as a column pin yet it is not output capable, so the row pins are always pulled high.

34-39 should only be used as row pins here (with external pullups).

Francis
Posts: 4
Joined: Mon Jan 11, 2021 1:35 pm

Re: sensor_vn used as GPIO39 input

Postby Francis » Thu Jan 14, 2021 9:54 am

Thank you very much!

Here is the solution I finally use:

Code: Select all

byte rowPins[ROWS] = {25, 39, 34, 35};
byte colPins[COLS] = {33, 26, 32};
Cheers,

Francis

Who is online

Users browsing this forum: No registered users and 79 guests