Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

How does 4x4 keypad work?

Status
Not open for further replies.
How does the 4x4 keypad work?

I know the 4x4 keypad is consist of a matrix of switch, but how do the microcontroller recognize with key is being pressed?

for example, B4 is connected to B0,B1, B2, and B3. When SW1 is pressed, B0 and B4 is closed, thus B4 is HI. However, when B4 is HI, how does it know that it is SW1, but not SW5 or SW9 is being pressed?

Thanks。
 

Attachments

  • serkey16.gif
    serkey16.gif
    5 KB · Views: 7,153
you pull b4 high and check b0-b3. if one of those is pressed you do sometihing
if none is pressed put it low and pull b5 high and again check b0-b3.if one of those is pressed you do sometihing

if none is pressed put it low and pull b6 high and again check b0-b3.if one of those is pressed you do sometihing

if none is pressed put it low and pull b7 high and again check b0-b3.if one of those is pressed you do sometihing

go back to start

like thatyou can push only one button at the time and you should use a piezo to accnolige that key has been pressed
 
An easier way is to use 8 bits. 4 for rows & 4 for columns. When a key is pressed, bits 0-3 will identify the row & bits 4-7 will identify the column & the controller will know precisely which key has been pressed.
 
you cat do that cause if you press a swich and all b's are inputs then there will be no change. all will still be in 0 position. the best and only way to operate this kwypad is the one is just described
 
janetsmith2000@yahoo.com said:
How does the 4x4 keypad work?

I know the 4x4 keypad is consist of a matrix of switch, but how do the microcontroller recognize with key is being pressed?

MCU scans the 4 rows and 4 colums
usually 4 are inputs and 4 are outputs
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top