Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/17/09 12:01
Modified:
  07/17/09 12:06

Read: times


 
#167478 - RE: now am modified my code
Responding to: ???'s previous message
Actually wat u told earlier is correct, am using 4 * 4 keypad but am not masking any port make it has 4 bit use. But the thing is am getting right answer when i simulate the code means that seven_seg value. but its not displaying anything on the seven segment...
my indentation and punctuation are followed correctly but when i post this message it wil come like that i don't how i have to insert code in this, is der any procedure to insert code in this, if der is plz tel me sir

# include <reg51.h>
# include <stdio.h>

# define ROW P1
# define COL P2
# define SEVEN_SEG P3

char keypad [4][4] = { 0, 1, 2, 3,
4, 5, 6, 7,
8, 9, 10, 11,
12, 13, 14, 15 };

char seven_seg [ ] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x69,
0x6f, 0x79,0x63, 0xc7, 0x77, 0x63 };
//seven_seg used to display characters from zero to fifteen


void main ( ) {
char temp, row, col, count;
ROW = 0x0F;
COL = 0x00;
SEVEN_SEG = 0x00;

while ( 1 ) {
COL = 0x0F;
ROW = 0x00;
while ( !( ROW & 0x0F ) );
for ( temp = 0x01, count = 0; temp <= 0x08; temp <<= 1, count++ )
if ( temp & ROW ) {
row = count ;
break;
}

for ( COL = 0x01, temp = 0x01, col = count = 0; temp <= 0x08;
COL = (temp <<= 1), count++ )
if ( row & ROW ) {
col = count;
break;
}

temp = keypad [row][col];
SEVEN_SEG = seven_seg [temp];
}
}


Thank u for ur reply sir

List of 24 messages in thread
TopicAuthorDate
Keypad interface problem: My code not working..            01/01/70 00:00      
   Check in a simulator            01/01/70 00:00      
      RE:            01/01/70 00:00      
         Care for details            01/01/70 00:00      
            Formatted code            01/01/70 00:00      
            RE: i dint check the bounce            01/01/70 00:00      
               Bounce vital to think about            01/01/70 00:00      
                  Do document            01/01/70 00:00      
                     re: documentation prob            01/01/70 00:00      
                     Fixing prob:            01/01/70 00:00      
                        Did you search?            01/01/70 00:00      
                           RE: the search tool here is not the most powerful            01/01/70 00:00      
                           Karas's Keypad Scanner Code In C - detabbed            01/01/70 00:00      
                     Properly documented code            01/01/70 00:00      
                        Reasons and assumptions            01/01/70 00:00      
                           Per, you implied, but did not say            01/01/70 00:00      
   dangerous loops            01/01/70 00:00      
   code???            01/01/70 00:00      
   RE: now am modified my code            01/01/70 00:00      
      How to post legible source code            01/01/70 00:00      
         unfortunately, that does not add comments            01/01/70 00:00      
         re: thanks now i got how to insert code            01/01/70 00:00      
   Scanning Keypad            01/01/70 00:00      
   How to scan Keypad            01/01/70 00:00      

Back to Subject List