program for Creating look up table for 8051 microcontroller

Status
Not open for further replies.
Hi

I'm doing a project "PREPAID ENERGY METER" . I need to interface a 4×4 keypad with 89c51 .. For this i need to create a look up table .. I dont know to write the program to create a look up table.. can anyone help me, please ??

I'm using Keil software for programming..


-- Kavitha
 
Hi, can you clarify for me - you do not know how to read the lookup table to see which button has beenpressed. Or you dont know how to make the lookup table in the first place.? for a 4x4 matrix, you would only have 16 elements in the table. so you would just enter the codes yourself. no need fora program to generate it.
 
i dnt knw to make the look up table and also dnt knw to read the lokup table to find which key has been pressed...... i dnt knw the codes for that .. I'm new to this ... pls help ..
 
In Keil C, I use an array of values like this, where 'code' puts the data in ROM with the program:

code unsigned char look_up_table[] = {14,23,97,5,18,122,58};// ROM table

Then access the 'nth' value like this:

value=look_up_table[n];

I hope I remembered properly.
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…