Discussion in "Project Doubts" started by    onyot    Nov 23, 2010.
Wed Nov 24 2010, 11:55 am
#31
void save (unsigned char c)
{
if(c=='*')
{
if(a!=0)
a--;
return;
}

if(a==5 && c=='#')
{
a=0;
compare();

	if(t==1)
	{
	  if(true==1) // if match ok
	  {
       correct=0;
	   t=2;
       for(d=0; d<7; d++)	   // on and after 10 sec off nw keypad can't get data
       DelayMs(1000);	 // max delay u can get is DelayMs(65535) otherwise need looping for big delay
       correct=1;
	   z=0;
       a=0;           // start agian from 0 location of array
 
      }
	}

	else if(t==2)
	  {
	    doorclose=0;
		t=1;
	    for(d=0; d<5; d++)	 
        DelayMs(1000);	 
        doorclose=1;
	  }






void save (unsigned char c)
{
if(c=='*')
{
if(a!=0)
a--;
return;
}

if(a==5 && c=='#')
{
a=0;
compare();

if(t==1)
{
if(true==1) // if match ok
{
DelayMs(800);
correct=0;
t=2;
for(d=0; d<7; d++) // on and after 10 sec off nw keypad can't get data
DelayMs(1000); // max delay u can get is DelayMs(65535) otherwise need looping for big delay
correct=1;
z=0;
a=0; // start agian from 0 location of array

}
else if(true==0)
goto error;

}



Thus goto error above is just an additional feature?
Wed Nov 24 2010, 12:03 pm
#32
hi onyot.josephian

in my project what is best to monitor, especially using a keypad? is it high or low?


u want to say monitor the pin status of 8051 to check which key is press
in normal case rows pins is 0 and columns r 1 when any key press corresponding column goes low then we high a row once at a time and see is column is low or high to check that is key press in this row or next rows

unsigned char code password[5]= "12345";


it mean code is 12345

Is it okay to connect my keypad directly to the pins of 8051?


yes keypad is connected directly to pin of controller it is ok

What type of display is it? seven segment or lcd?


in this project romel use 7 seg u can use lcd too
7 seg is connected to port 3 of controller using a decoder ic
any decoder ic can be used 74ls74,74ls48 or 4511
7-seg can be directly connected to port pins without using decoder ic
Wed Nov 24 2010, 12:04 pm
#33
do not post the same code again just edit the previous one
Wed Nov 24 2010, 12:20 pm
#34
Ok...

Is it okay also to connect all the a,b,c,d,e,f,g,dot to 6 seven segment? (a is to a, b is to b, and so on)
And what part of the program I've posted is the 7segment initialization... It looks like, it only check the password and not displaying it, or it looks like, it is using a decoder..


[ Edited Wed Nov 24 2010, 12:23 pm ]
Wed Nov 24 2010, 12:23 pm
#35
yes if u want to do multiplexing then connect a to a, b to b ..........g to g
leave common pin of 7-seg
in multiplexing common pin is controlled by the controller using transistors
Wed Nov 24 2010, 12:24 pm
#36
how I can put a picture here? I dunno how....


[ Edited Wed Nov 24 2010, 12:25 pm ]
Wed Nov 24 2010, 12:35 pm
#37
save pic in jpg formate
click on preview at the bottom of page
then browse to picture and then click on reply to thread
this line display on 7-seg which key press

display=((display & 0xf0) | (displayb[rowloc][0])); // display to 7 seg



[ Edited Wed Nov 24 2010, 12:37 pm ]
Wed Nov 24 2010, 12:40 pm
#38





Is it okay? Is it right? If there are transistors, it means that I should include it in my program? if yes, the function of this is to locate what 7segment should I activate, am I right?
Wed Nov 24 2010, 12:47 pm
#39
I just wanna ask again, in the program, it declare the P3 as the display, then it declare P3^5 as correct, P3^4 as wrong and P3^7 as key, so where does the 7 segment be pinned?
I'm confused with this initialization....
Wed Nov 24 2010, 12:54 pm
#40
is there anybody here that knows, a program that will automatically detect the code that I've input from keypad. example, I press 12345, then it will automatically detected by the program inside the 8051, and next is it will prompt that I should enter the number of products being produced.

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

RodneyKnorb
Thu Apr 25 2024, 07:08 pm
Williamjef
Thu Apr 25 2024, 02:08 pm
SamuelSmise
Thu Apr 25 2024, 09:56 am
DustinErele
Thu Apr 25 2024, 08:44 am
ztaletpzca
Wed Apr 24 2024, 11:19 pm
IrardlPex
Wed Apr 24 2024, 08:42 pm
Charlestehed
Wed Apr 24 2024, 05:20 pm
Robertgurse
Wed Apr 24 2024, 02:43 pm