Change Pullup Mode in Keypad.h Library

Hello,

I am Ansh, I was trying to create a keypad using Arduino UNO and Keypad.h library for ease. My circuit is working fine with the library and it has it pull-up resistors too. But when I searched on the Keypad.h library I got to know that the library uses internal pull-up.

I don't want to use the internal pull-up of the micro-controller. So if there is any way to change the mode from internal pull-up to INPUT only so that my resistors could be used in the circuit in the Keypad.h library then please help me.

Regards,
Ansh Goel

I don't know the answer but I think you will find that the word "urgent" in your Title has a negative effect. It creates the impression that you want to jump the queue.

If you edit your Original Post you can change the Title.

...R

Go and edit the library. Quickly, because it's urgent. If you really can't figure out how to do that, provide the details of what you tried, and we will help.

Robin2:
I don't know the answer but I think you will find that the word "urgent" in your Title has a negative effect. It creates the impression that you want to jump the queue.

If you edit your Original Post you can change the Title.

...R

Thanks for your reply I really don't wanted the post to go that way. if the urgent word is not suitable I will remove it :slight_smile:

aarg:
Go and edit the library. Quickly, because it's urgent. If you really can't figure out how to do that, provide the details of what you tried, and we will help.

Hello, Thank you for replying.

I have never edited a library. Please help

here is the code I tried

#include <Keypad.h>

const byte ROWS = 3; //four rows
const byte COLS = 4; //four columns
//define the cymbols on the buttons of the keypads
char hexaKeys[ROWS][COLS] = {
  {'0','1','2','3'},
  {'4','5','6','7'},
  {'8','9','A','B'}
};
byte rowPins[ROWS] = {10, 11, 12}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {9, 8, 7, 6}; //connect to the column pinouts of the keypad

//initialize an instance of class NewKeypad
Keypad customKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS); 

void setup(){
  Serial.begin(9600);
}
  
void loop(){
  char customKey = customKeypad.getKey();
  
  if (customKey){
    Serial.println(customKey);
  }

  if(customKey == '0'){
    Serial.println("Hello");
  }
}

I only want to use my circuit pullups other than the internal pullp ups

Will your external pullups be disconnected during operation?
If not, then just leave the weak (30K to 50K ohm) internal pullups as is, and add your own if you really think they are needed.
You should be able to disable the internal pullups by using
pinMode (keypadPinX, INPUT);
for the various pins after you Keypad.begin() or however the library starts in setup().

CrossRoads:
Will your external pullups be disconnected during operation?
If not, then just leave the weak (30K to 50K ohm) internal pullups as is, and add your own if you really think they are needed.
You should be able to disable the internal pullups by using
pinMode (keypadPinX, INPUT);
for the various pins after you Keypad.begin() or however the library starts in setup().

Thank you for replying Sir,

My Pull ups will not be disconnected during the operation.

Thank you for your help sir,

Will only specifing the pinMode to input change the mode from internal pullup to pullup from the library?

And is this what you are talking about?

const byte ROWS = 3; //four rows
const byte COLS = 4; //four columns
//define the cymbols on the buttons of the keypads
char hexaKeys[ROWS][COLS] = {
  {'0','1','2','3'},
  {'4','5','6','7'},
  {'8','9','A','B'}
};
byte rowPins[ROWS] = {10, 11, 12}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {9, 8, 7, 6}; //connect to the column pinouts of the keypad

//initialize an instance of class NewKeypad
Keypad customKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS); 

void setup(){
  Serial.begin(9600);

  pinMode(10,INPUT);
  pinMode(9,INPUT);
  pinMode(8,INPUT);
  pinMode(6,INPUT);
  pinMode(11,INPUT);
  pinMode(12,INPUT);
  pinMode(7,INPUT);

  digitalWrite(10,HIGH);
  digitalWrite(11,HIGH);
  digitalWrite(12,HIGH);
  digitalWrite(9,HIGH);
  digitalWrite(8,HIGH);
  digitalWrite(7,HIGH);
  digitalWrite(6,HIGH);
}
  
void loop(){
  char customKey = customKeypad.getKey();
  
  if (customKey){
    Serial.println(customKey);
  }

  if(customKey == '0'){
    Serial.println("Hello");
  }
}
[code]

This line
pinMode(10,INPUT);
followed by this line
digitalWrite(10,HIGH);
turns on the internal pullup, and is the same as using
pinMode(10,INPUT_PULLUP);

Use
pinMode(10,INPUT);
digitalWrite(10,LOW);
to turn it off.

CrossRoads:
This line
pinMode(10,INPUT);
followed by this line
digitalWrite(10,HIGH);
turns on the internal pullup, and is the same as using
pinMode(10,INPUT_PULLUP);

Use
pinMode(10,INPUT);
digitalWrite(10,LOW);
to turn it off.

CrossRoads:
This line
pinMode(10,INPUT);
followed by this line
digitalWrite(10,HIGH);
turns on the internal pullup, and is the same as using
pinMode(10,INPUT_PULLUP);

Use
pinMode(10,INPUT);
digitalWrite(10,LOW);
to turn it off.

Okay, Thanks for the reply