Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

MPLABX(C18) PIC18F4321 4x3 Keypad

Not open for further replies.


Sep 28, 2021
Reaction score
Trophy points
Activity points
HI I am trying to write a program to read a 4 digits number from the keypad and display a message on the screen, not sure what comands to use to read form the keypad and how to store the keys


A rather unelaborated question, short, without details about your skills and the used equippment.....

You need to choose a programming language
You need to choose an editor and a compiler.
Then go through some tutorials.

Reading a 4x3 kepad matrix is often used as school project thus there are many discussions, videos, code examples in the internet. Go through them.

Then please ask a more detailed question.
Don´t expect anyone here writes code for you.


Yes, i am very new to programming.

I can read and display 1 digit from the keypad on the LCD screen.

But i want to read 4 digits from the keypad.

Not sure how to go on about this and what commands to use.

Before discussing further:
- Do you have some kind of development board? If yes, which one?
- Do you have a keypad? An LCD?

If you don't have anything, you may consider buying something inexpensive
First, the keypad and the LCD. I like real keys, not the plastic capsule kind.
The LCD is a 4lines x 20 char. You can find cheaper items, but on the other hand,
it depends whether you want to build one program and then forget everything or
if you want to invest some time on the long term.

You may consider buying a few LEDs with their resistors. A Led is like "Hello World" in
the MCU community.

[ I just notice that what follows is off topic because you are considering PIC. I leave this
in case somebody else find it useful]

Now for the processor itself, it's a little bit trickier.
Similarly, it depends on what you want to do.
- You have the Arduino series, very easy (too easy??) to use, but you will not learn as much.
- There are myriads of other chips.

From my point of view, may not an ARM chip from the beginning, because it's not easy to
start without some basic understanding.

I would recommend for instance MSP430 (quite powerful boards around 20 USD or less),
very simple to start with. It's the simplest chip I have used. But I haven't tried everything.
That's about it without further info.

Last edited:

Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to