Sumit Grover
Published © LGPL

fingerprint attendance system with SMS acknowledgement

In our basic attendance system the SMS feature is introduced to acknowledge the absentees. it also help in case a person forgot to punch in.

IntermediateFull instructions provided2,591
fingerprint attendance system with SMS acknowledgement

Things used in this project

Hardware components

r305 fingerprint module
×1
RGB Backlight LCD - 16x2
Adafruit RGB Backlight LCD - 16x2
×1
transformer
×1
1N4007 – High Voltage, High Current Rated Diode
1N4007 – High Voltage, High Current Rated Diode
×4
Linear Regulator (7805)
Linear Regulator (7805)
×5
1000uf
×1
10uf
×1
GSM modem
×1
P89V51RD2 ic
×1
DS1307 ic
×1
24C64 ic
×1
8 pin ic base
×1
40 pin ic base
×1
1k
×1
10 k ohm
×1

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

circuit diagram

Code

code.txt

C/C++
#include<reg51.h>														   
#include<intrins.h>

sbit SCL=P2^7;
sbit SDA=P0^7; 
 
sbit SCL_TIME=P2^6;	
sbit SDA_TIME=P2^5;

sbit fingerprint=P3^2;
sbit usb=P3^3;

sbit add_user_switch=P2^4;		  
sbit delete_user_swtich=P2^3;
sbit delete_data_switch=P2^2;
sbit send_data_switch=P2^1;
sbit match_switch=P2^0;

sbit rs=P3^6;
sbit en=P3^7;

unsigned char enroll_finger[]={0xEF,0x01,0xFF,0xFF,0xFF,0xFF,0x01,0x00,0x03,0x01,0x00,0x05};///12 
unsigned char store_to_buffer[]={0xEF,0x01,0xFF,0xFF,0xFF,0xFF,0x01,0x00,0x04,0x02,0x01,0x00,0x08};//13
unsigned char store_to_library[]={0xEF,0x01,0xFF,0xFF,0xFF,0xFF,0x01,0x00,0x06,0x06,0x01,0x00,0x00,0x00,0x0E};//15
unsigned char match_the_library[]={0xEF,0x01,0xFF,0xFF,0xFF,0xFF,0x01,0x00,0x08,0x04,0x01,0x00,0x01,0x00,0xF0,0x00,0xFF};//17	 
unsigned char delete_user[]={0xEF,0x01,0xFF,0xFF,0xFF,0xFF,0x01,0x00,0x03,0x0D,0x00,0x11};///12 

unsigned char sec,hrs,min,date,month,year;

void delay(unsigned int z)
{
unsigned int c;
for(c=0;c<z;c++);
}
  
void cd(unsigned char c)
{
P1=c;
rs=0;
en=1;
delay(300);
en=0;
}

void dd(unsigned char c)
{
P1=c;
rs=1;
en=1;
delay(300);
en=0;
}

void lcd(unsigned char *h)
{
while(*h!=0)
{
dd(*h);
h++;
}
}

void init()
{
cd(0X38);
cd(0X01);
cd(0X06);
cd(0X0C);
}

void tx(unsigned char num)
{ 
  SBUF = num;
  while(TI == 0);
  TI = 0;
}

void tx_string(unsigned char *y)
{
	while(*y!='\0')
	{
		tx(*y);
		y++;
	}
}

void start()
{
   SDA = 1 ;	   _nop_() , _nop_() , _nop_() ;
   SCL = 1 ;	   _nop_() , _nop_() , _nop_() ;
   SDA = 0 ; 	   _nop_() , _nop_() , _nop_() ;
   SCL = 0 ;	   _nop_() , _nop_() , _nop_() ;
}

void stop()
{
   SDA = 0 ;	 _nop_() , _nop_() , _nop_() ;
   SCL = 1 ;	 _nop_() , _nop_() , _nop_() ;
   SDA = 1 ;	 _nop_() , _nop_() , _nop_() ;
   SCL = 0 ;	 _nop_() , _nop_() , _nop_() ;
}

void clock()
{
   SCL = 1 ;	 _nop_() ; _nop_() ; _nop_() ;
   SCL = 0 ;	 _nop_() ; _nop_() ; _nop_() ;
}

void nack()
{
    SDA = 1 ;	  clock() ;
} 

void waitack()
{
    SDA = 1 ;	  clock() ;
}

void opdat(unsigned char dat)
{
   unsigned char i ;
   for ( i = 0 ; i < 8 ; i++ )
   {
      if ( ( dat >> ( 7 - i ) ) & 0x01 ) 	SDA = 1 ; 
      else	 			SDA = 0 ;
      clock() ;
   }
}

void i2c_write(unsigned char dat,unsigned char upper_addr,unsigned char lower_addr)
{                   	
	start();		 //dummy write start 	
	opdat(0xa0);	//send dev addr
	waitack();	
	opdat(upper_addr);
	waitack();
	opdat(lower_addr);
	waitack();
	opdat(dat);		//write data
	waitack();
	stop();
}	

void i2c_write1(unsigned char dat,unsigned char upper_addr,unsigned char lower_addr)
{                   	
	start();		 //dummy write start 	
	opdat(0xa2);	//send dev addr
	waitack();	
	opdat(upper_addr);
	waitack();
	opdat(lower_addr);
	waitack();
	opdat(dat);		//write data
	waitack();
	stop();
}			  

unsigned char getdat()
{
   unsigned char i , dat;
   SDA = 1;	   _nop_() , _nop_() , _nop_();
 for ( i = 0 ; i < 8 ; i++ ) 
   {
	  dat = ( ( ( dat << 1 ) & 0xfe ) | SDA );
	  clock();
   }
   return dat;
}

unsigned char i2c_read(unsigned char upper_addr,unsigned char lower_addr)
{ 
 unsigned char rdata;
start();		//dummy write start
opdat(0xa0);	//send dev addr
waitack();	  
opdat(upper_addr);
waitack();
opdat(lower_addr);
waitack();
	start();				//start read
       opdat(0xa1);   //give device adddr or with for read 
        waitack();	//operation coz lsb gives r|w
        rdata = getdat();
        nack() ;
        stop() ;
        return(rdata);
} 

unsigned char i2c_read1(unsigned char upper_addr,unsigned char lower_addr)
{ 
 unsigned char rdata;
start();		//dummy write start
opdat(0xa2);	//send dev addr
waitack();	  
opdat(upper_addr);
waitack();
opdat(lower_addr);
waitack();
	start();				//start read
       opdat(0xa3);   //give device adddr or with for read 
        waitack();	//operation coz lsb gives r|w
        rdata = getdat();
        nack() ;
        stop() ;
        return(rdata);
}

void start_TIME()
{
   SDA_TIME = 1 ;	   _nop_() , _nop_() , _nop_() ;
   SCL_TIME = 1 ;      _nop_() , _nop_() , _nop_() ;
   SDA_TIME = 0 ;	   _nop_() , _nop_() , _nop_() ;
   SCL_TIME = 0 ;	   _nop_() , _nop_() , _nop_() ;
}

void stop_TIME()
{
   SDA_TIME = 0 ;	   _nop_() , _nop_() , _nop_() ;
   SCL_TIME = 1 ;	   _nop_() , _nop_() , _nop_() ;
   SDA_TIME = 1 ;	   _nop_() , _nop_() , _nop_() ;
   SCL_TIME = 0 ;	   _nop_() , _nop_() , _nop_() ;
}

void clock_TIME()
{
   SCL_TIME = 1 ;	   _nop_() ; _nop_() ; _nop_() ;
   SCL_TIME = 0 ;	   _nop_() ; _nop_() ; _nop_() ;
}

void nack_TIME()
{
   SDA_TIME = 1 ;
   clock_TIME() ;
}

void waitack_TIME()
{
   SDA_TIME = 1 ;
   clock_TIME();
}

unsigned char getdat_TIME(void)
{
   unsigned char i , dat;
   SDA_TIME = 1;		   _nop_() , _nop_() , _nop_();
   for ( i = 0 ; i < 8 ; i++ ) 
   {
       dat = ( ( ( dat << 1 ) & 0xfe ) | SDA_TIME );
 	   clock_TIME();
   }
   return dat;
}

void opdat_TIME(unsigned char dat)
{
   unsigned char i ;

   for ( i = 0 ; i < 8 ; i++ )
   {
	  if ( ( dat >> ( 7 - i ) ) & 0x01 )	SDA_TIME = 1 ; 
      else	 							  	SDA_TIME = 0 ;
      clock_TIME() ;     
   }
}

void i2c_write_TIME(unsigned char dat1, unsigned char add1)
{
 unsigned char dat;

 dat=( ( ( dat1 / 10 ) << 4 ) | ( dat1 % 10 ) );

 start_TIME();
 opdat_TIME(0xd0);
 waitack_TIME();
 opdat_TIME(add1);
 waitack_TIME();
 opdat_TIME(dat);
 waitack_TIME();
 stop_TIME();
}

unsigned char i2c_read_TIME(unsigned char add)
{
 unsigned char rdata,send;

 start_TIME();
 opdat_TIME(0xd0);
 waitack_TIME();
 opdat_TIME(add);
 waitack_TIME();
 start_TIME();
 opdat_TIME(0xd1);
 waitack_TIME();
 rdata=getdat_TIME();
 nack_TIME();
 stop_TIME();
 
 send=( ( ( rdata >> 4) * 10 ) + ( rdata & 0x0f ) );
 return(send);
}

 void main()
{		
unsigned char b,u,rtc_display,t,array1[15],array2[15],array3[15],no_of_user,whether_data_deleted_successfully,whether_user_deleted_successfully,date_database_value,date_database_value1;
unsigned char current_day_hour,current_day_min,back_up_date,back_up_time,overwrite_condition,current_day_year,previous_day_year,current_day_month,previous_day_month,current_day_date,previous_day_date;
 PCON=0x80;
 SCON=0x50;
  TMOD=0x20;
  TH1=0xff;
  TR1=1;	
  init();					  
cd(0x80);
lcd("  FINGERPRINT   ");
cd(0xc0);
lcd("ATTENDANCE SYS..");	
  no_of_user=i2c_read(0,255);	 
  delay(100);
  if(no_of_user>100)
  i2c_write(1,0,255);		 ///data,location
  delay(1200);	 
date_database_value=i2c_read(0,252); 
delay(100);
if(date_database_value>64)			 			
i2c_write(0,0,252);		 ///data,location
delay(1200);													
delay(60000);					   
delay(60000);
whether_data_deleted_successfully=i2c_read(0,254);		
delay(100);
if(whether_data_deleted_successfully==0)
goto wer;		
whether_user_deleted_successfully=i2c_read(0,253);		
delay(100);
if(whether_user_deleted_successfully==0)
goto ert;			 
qwe:
cd(0x01);
while(1)
{ 
     
		  
	else if(date_database_value>=24 && date_database_value<32)
	{		   
i2c_write1(current_day_date,((date_database_value-24)*4),61);		 ///data,location
delay(1200);								  
i2c_write1(current_day_month,(((date_database_value-24)*4)+1),61);		 ///data,location
delay(1200);
i2c_write1(current_day_year,(((date_database_value-24)*4)+2),61);		 ///data,location
delay(1200);
for(u=((date_database_value-24)*4);u<(((date_database_value-24)*4)+4);u++)
{
for(t=62;t<=121;t++)
{  
i2c_write1(255,u,t);		 ///data,location
delay(1200);
}
}
	}		   
		  
	else if(date_database_value>=32 && date_database_value<40)
	{		   
i2c_write(current_day_date,((date_database_value-32)*4),122);		 ///data,location
delay(1200);								  
i2c_write(current_day_month,(((date_database_value-32)*4)+1),122);		 ///data,location
delay(1200);
i2c_write(current_day_year,(((date_database_value-32)*4)+2),122);		 ///data,location
delay(1200);
for(u=((date_database_value-32)*4);u<(((date_database_value-32)*4)+4);u++)
{
for(t=123;t<=182;t++)
{  
i2c_write(255,u,t);		 ///data,location
delay(1200);
}
}
	}
		 
	else if(date_database_value>=40 && date_database_value<48)
	{		   
i2c_write1(current_day_date,((date_database_value-40)*4),122);		 ///data,location
delay(1200);								  
i2c_write1(current_day_month,(((date_database_value-40)*4)+1),122);		 ///data,location
delay(1200);
i2c_write1(current_day_year,(((date_database_value-40)*4)+2),122);		 ///data,location
delay(1200);
for(u=((date_database_value-40)*4);u<(((date_database_value-40)*4)+4);u++)
{
for(t=123;t<=182;t++)
{  
i2c_write1(255,u,t);		 ///data,location
delay(1200);
}
}
	}		
		 
	else if(date_database_value>=48 && date_database_value<56)
	{		   
i2c_write(current_day_date,((date_database_value-48)*4),183);		 ///data,location
delay(1200);								  
i2c_write(current_day_month,(((date_database_value-48)*4)+1),183);		 ///data,location
delay(1200);
i2c_write(current_day_year,(((date_database_value-48)*4)+2),183);		 ///data,location
delay(1200);
for(u=((date_database_value-48)*4);u<(((date_database_value-48)*4)+4);u++)
{
for(t=184;t<=243;t++)
{  
i2c_write(255,u,t);		 ///data,location
delay(1200);
}
}
	}	 
		 
	else if(date_database_value>=56 && date_database_value<64)
	{		   
i2c_write1(current_day_date,((date_database_value-56)*4),183);		 ///data,location
delay(1200);								  
i2c_write1(current_day_month,(((date_database_value-56)*4)+1),183);		 ///data,location
delay(1200);
i2c_write1(current_day_year,(((date_database_value-56)*4)+2),183);		 ///data,location
delay(1200);
for(u=((date_database_value-56)*4);u<(((date_database_value-56)*4)+4);u++)
{
for(t=184;t<=243;t++)
{  
i2c_write1(255,u,t);		 ///data,location
delay(1200);
}
}
	}

	i2c_write((date_database_value+1),0,252);
	delay(1200);
  }
}

if(add_user_switch==0)
{
  fingerprint=0;
  usb=1;  	   
cd(0x80);
lcd(" PUT THE FINGER ");
cd(0xc0);
lcd("  ON THE SENSOR ");
delay(60000);			 
delay(60000);			
delay(60000);
  for(t=0;t<12;t++)
  {
  tx(enroll_finger[t]);
  }
delay(60000);
  for(t=0;t<12;t++)
  {
  while(RI==0);
  array1[t]=SBUF;
  RI=0;
  }
if(array1[9]==0x00)
  {
  RI=0;
  for(t=0;t<13;t++)
  {
  tx(store_to_buffer[t]);
  }
delay(60000);
  for(t=0;t<12;t++)
  {
  while(RI==0);
  array2[t]=SBUF;
  RI=0;
  }
  if(array2[9]==0x00)
  {
  no_of_user=i2c_read(0,255);	 
  delay(100);
  if(no_of_user>60)
{		  
cd(0x80);
lcd("  MAXIMUM USER  ");
cd(0xc0);
lcd("ALREADY  REACHED");
delay(60000);			 
delay(60000);
goto qwe;
}		 
  for(t=0;t<15;t++)
  {
  RI=0;
  if(t==12 || t==14)
  {		
  tx(store_to_library[t]+no_of_user);
  }
  else
  {
  tx(store_to_library[t]);
  }
  }	  
for(t=0;t<12;t++)
  {
  while(RI==0);
  array3[t]=SBUF;
  RI=0;
  }
  if(array3[9]==0x00)
  {		   			
cd(0x80);
lcd(" USER  "); 
dd((no_of_user/10)+0x30);
dd((no_of_user%10)+0x30);
 lcd(" ADDED ");
cd(0xc0);
lcd("  SUCCESSFULLY  ");  
  i2c_write((no_of_user+1),0,255);		 ///data,location
delay(60000);			 
delay(60000);
goto qwe;
  }
  	
  else
  {				  
  cd(0x80);
  lcd(" ERROR  OCCURED ");
  cd(0xc0);
  lcd("PLEASE TRY AGAIN");	  
delay(60000);			 
delay(60000);		
goto qwe; 
  }
    
  }
  
  else
  {				  
  cd(0x80);
  lcd(" ERROR  OCCURED ");
  cd(0xc0);
  lcd("PLEASE TRY AGAIN");	  
delay(60000);			 
delay(60000);		
goto qwe; 
  }

  }
  
  else
  {				  
  cd(0x80);
  lcd(" ERROR  OCCURED ");
  cd(0xc0);
  lcd("PLEASE TRY AGAIN");	  
delay(60000);			 
delay(60000);		
goto qwe; 
  }

}
else if(delete_user_swtich==0)   	  
{  
ert:							 
  cd(0x80);	 
  fingerprint=0;
  usb=1;  	 
  lcd(" DELETING  USER ");
  cd(0xc0);
  lcd("PLEASE WAIT.....");	 
  for(t=0;t<12;t++)
  {
  tx(delete_user[t]);
  }
  RI=0;
delay(60000);
  for(t=0;t<12;t++)
  {
  while(RI==0);
  array1[t]=SBUF;
  RI=0;
  } 	
  if(array1[9]==0x00)
  {						  			
  i2c_write(1,0,255);		 ///data,location
  delay(1200);	  			 			
i2c_write(0,0,253);		 ///data,location
delay(1200);							
date_database_value=i2c_read(0,252);		 
delay(100);				  
if(date_database_value<=8)
{
for(u=0;u<=31;u++)
{
if(u==3 || u==7 || u==11 || u==15 || u==19 || u==23 || u==27 || u==31)
goto dfm;
i2c_write(255,u,0);		 ///data,location
delay(1200);		
dfm:
delay(1);		 		
}
}					  	  
else if(date_database_value<=16)
{
for(u=0;u<=31;u++)
{
if(u==3 || u==7 || u==11 || u==15 || u==19 || u==23 || u==27 || u==31)
goto sdm;
i2c_write(255,u,0);		 ///data,location
delay(1200);			 						
i2c_write1(255,u,0);		 ///data,location
delay(1200);		
sdm:
delay(1);		 		
}
}					  
else if(date_database_value<=24)
{
for(u=0;u<=31;u++)
{
if(u==3 || u==7 || u==11 || u==15 || u==19 || u==23 || u==27 || u==31)
goto asm;
i2c_write(255,u,0);		 ///data,location
delay(1200);			 						
i2c_write1(255,u,0);		 ///data,location
delay(1200);		
i2c_write(255,u,61);		 ///data,location
delay(1200);		
asm:
delay(1);		 		
}
}				
else if(date_database_value<=32)
{
for(u=0;u<=31;u++)
{
if(u==3 || u==7 || u==11 || u==15 || u==19 || u==23 || u==27 || u==31)
goto iom;
i2c_write(255,u,0);		 ///data,location
delay(1200);			 						
i2c_write1(255,u,0);		 ///data,location
delay(1200);		
i2c_write(255,u,61);		 ///data,location
delay(1200);			 						
i2c_write1(255,u,61);		 ///data,location
delay(1200);		
iom:
delay(1);		 		
}
}				
else if(date_database_value<=40)
{
for(u=0;u<=31;u++)
{
if(u==3 || u==7 || u==11 || u==15 || u==19 || u==23 || u==27 || u==31)
goto uim;
i2c_write(255,u,0);		 ///data,location
delay(1200);			 						
i2c_write1(255,u,0);		 ///data,location
delay(1200);		
i2c_write(255,u,61);		 ///data,location
delay(1200);			 						
i2c_write1(255,u,61);		 ///data,location
delay(1200);		
i2c_write(255,u,122);		 ///data,location
delay(1200);		
uim:
delay(1);		 		
}
}					
else if(date_database_value<=48)
{
for(u=0;u<=31;u++)
{
if(u==3 || u==7 || u==11 || u==15 || u==19 || u==23 || u==27 || u==31)
goto yum;
i2c_write(255,u,0);		 ///data,location
delay(1200);			 						
i2c_write1(255,u,0);		 ///data,location
delay(1200);		
i2c_write(255,u,61);		 ///data,location
delay(1200);			 						
i2c_write1(255,u,61);		 ///data,location
delay(1200);		
i2c_write(255,u,122);		 ///data,location
delay(1200);			 						
i2c_write1(255,u,122);		 ///data,location
delay(1200);		
yum:
delay(1);		 		
}
}			
else if(date_database_value<=56)
{
for(u=0;u<=31;u++)
{
if(u==3 || u==7 || u==11 || u==15 || u==19 || u==23 || u==27 || u==31)
goto tym;
i2c_write(255,u,0);		 ///data,location
delay(1200);			 						
i2c_write1(255,u,0);		 ///data,location
delay(1200);		
i2c_write(255,u,61);		 ///data,location
delay(1200);			 						
i2c_write1(255,u,61);		 ///data,location
delay(1200);		
i2c_write(255,u,122);		 ///data,location
delay(1200);			 						
i2c_write1(255,u,122);		 ///data,location
delay(1200);		
i2c_write(255,u,183);		 ///data,location
delay(1200);		
tym:
delay(1);		 		
}
}	
else if(date_database_value<=64)
{
for(u=0;u<=31;u++)
{
if(u==3 || u==7 || u==11 || u==15 || u==19 || u==23 || u==27 || u==31)
goto rtm;
i2c_write(255,u,0);		 ///data,location
delay(1200);			 						
i2c_write1(255,u,0);		 ///data,location
delay(1200);		
i2c_write(255,u,61);		 ///data,location
delay(1200);			 						
i2c_write1(255,u,61);		 ///data,location
delay(1200);		
i2c_write(255,u,122);		 ///data,location
delay(1200);			 						
i2c_write1(255,u,122);		 ///data,location
delay(1200);		
i2c_write(255,u,183);		 ///data,location
delay(1200);			 						
i2c_write1(255,u,183);		 ///data,location
delay(1200);	
rtm:
delay(1);		 		
}
}									
i2c_write(0,0,244);		 ///data,location
delay(1200);						
i2c_write(0,0,245);		 ///data,location
delay(1200);							
i2c_write(0,0,246);		 ///data,location
delay(1200);							
i2c_write(0,0,252);		 ///data,location
delay(1200);									
i2c_write(255,0,251);		 ///data,location
delay(1200);											
i2c_write(255,0,253);		 ///data,location
delay(1200);			  
  cd(0x80);
  lcd("ALL USER DELETED");
  cd(0xc0);
  lcd("  SUCCESSFULLY  ");	
delay(60000);	  			
delay(60000);	  
  }	  
else
{		 					
  cd(0x80);
  lcd(" ERROR  OCCURED ");
  cd(0xc0);
  lcd("PLEASE TRY AGAIN");	 
delay(60000);	  			 
delay(60000);	  
}
goto qwe;
}

else if(delete_data_switch==0)   	  
{	
wer:
cd(0x80);
lcd(" DELETING  DATA ");
cd(0xc0);
lcd("PLEASE WAIT.....");				
i2c_write(0,0,254);		 ///data,location
delay(1200);								
date_database_value=i2c_read(0,252);		 
delay(100);				  
if(date_database_value<=8)
{
for(u=0;u<=31;u++)
{
if(u==3 || u==7 || u==11 || u==15 || u==19 || u==23 || u==27 || u==31)
goto dfg;
i2c_write(255,u,0);		 ///data,location
delay(1200);		
dfg:
delay(1);		 		
}
}					  	  
else if(date_database_value<=16)
{
for(u=0;u<=31;u++)
{
if(u==3 || u==7 || u==11 || u==15 || u==19 || u==23 || u==27 || u==31)
goto sdf;
i2c_write(255,u,0);		 ///data,location
delay(1200);			 						
i2c_write1(255,u,0);		 ///data,location
delay(1200);		
sdf:
delay(1);		 		
}
}					  
else if(date_database_value<=24)
{
for(u=0;u<=31;u++)
{
if(u==3 || u==7 || u==11 || u==15 || u==19 || u==23 || u==27 || u==31)
goto asd;
i2c_write(255,u,0);		 ///data,location
delay(1200);			 						
i2c_write1(255,u,0);		 ///data,location
delay(1200);		
i2c_write(255,u,61);		 ///data,location
delay(1200);		
asd:
delay(1);		 		
}
}				
else if(date_database_value<=32)
{
for(u=0;u<=31;u++)
{
if(u==3 || u==7 || u==11 || u==15 || u==19 || u==23 || u==27 || u==31)
goto iop;
i2c_write(255,u,0);		 ///data,location
delay(1200);			 						
i2c_write1(255,u,0);		 ///data,location
delay(1200);		
i2c_write(255,u,61);		 ///data,location
delay(1200);			 						
i2c_write1(255,u,61);		 ///data,location
delay(1200);		
iop:
delay(1);		 		
}
}				
else if(date_database_value<=40)
{
for(u=0;u<=31;u++)
{
if(u==3 || u==7 || u==11 || u==15 || u==19 || u==23 || u==27 || u==31)
goto uio;
i2c_write(255,u,0);		 ///data,location
delay(1200);			 						
i2c_write1(255,u,0);		 ///data,location
delay(1200);		
i2c_write(255,u,61);		 ///data,location
delay(1200);			 						
i2c_write1(255,u,61);		 ///data,location
delay(1200);		
i2c_write(255,u,122);		 ///data,location
delay(1200);		
uio:
delay(1);		 		
}
}					
else if(date_database_value<=48)
{
for(u=0;u<=31;u++)
{
if(u==3 || u==7 || u==11 || u==15 || u==19 || u==23 || u==27 || u==31)
goto yui;
i2c_write(255,u,0);		 ///data,location
delay(1200);			 						
i2c_write1(255,u,0);		 ///data,location
delay(1200);		
i2c_write(255,u,61);		 ///data,location
delay(1200);			 						
i2c_write1(255,u,61);		 ///data,location
delay(1200);		
i2c_write(255,u,122);		 ///data,location
delay(1200);			 						
i2c_write1(255,u,122);		 ///data,location
delay(1200);		
yui:
delay(1);		 		
}
}			
else if(date_database_value<=56)
{
for(u=0;u<=31;u++)
{
if(u==3 || u==7 || u==11 || u==15 || u==19 || u==23 || u==27 || u==31)
goto tyu;
i2c_write(255,u,0);		 ///data,location
delay(1200);			 						
i2c_write1(255,u,0);		 ///data,location
delay(1200);		
i2c_write(255,u,61);		 ///data,location
delay(1200);			 						
i2c_write1(255,u,61);		 ///data,location
delay(1200);		
i2c_write(255,u,122);		 ///data,location
delay(1200);			 						
i2c_write1(255,u,122);		 ///data,location
delay(1200);		
i2c_write(255,u,183);		 ///data,location
delay(1200);		
tyu:
delay(1);		 		
}
}	
else if(date_database_value<=64)
{
for(u=0;u<=31;u++)
{
if(u==3 || u==7 || u==11 || u==15 || u==19 || u==23 || u==27 || u==31)
goto rty;
i2c_write(255,u,0);		 ///data,location
delay(1200);			 						
i2c_write1(255,u,0);		 ///data,location
delay(1200);		
i2c_write(255,u,61);		 ///data,location
delay(1200);			 						
i2c_write1(255,u,61);		 ///data,location
delay(1200);		
i2c_write(255,u,122);		 ///data,location
delay(1200);			 						
i2c_write1(255,u,122);		 ///data,location
delay(1200);		
i2c_write(255,u,183);		 ///data,location
delay(1200);			 						
i2c_write1(255,u,183);		 ///data,location
delay(1200);	
rty:
delay(1);		 		
}
}									
i2c_write(0,0,244);		 ///data,location
delay(1200);						
i2c_write(0,0,245);		 ///data,location
delay(1200);							
i2c_write(0,0,246);		 ///data,location
delay(1200);							
i2c_write(0,0,252);		 ///data,location
delay(1200);									
i2c_write(255,0,251);		 ///data,location
delay(1200);							
i2c_write(255,0,254);		 ///data,location
delay(1200);			 		

cd(0x80);
lcd("ALL DATA DELETED");
cd(0xc0);
lcd("  SUCCESSFULLY  ");
delay(60000);						   
delay(60000);		
goto qwe;

}

else if(send_data_switch==0)   	  
{
   fingerprint=1;
   usb=0; 
cd(0x80);
lcd("  SENDING DATA  ");
cd(0xc0);
lcd("PLEASE WAIT.....");
delay(60000);
tx_string("FINGERPRINT ATTENDANCE SYSTEM - USB DATA SENDING");
tx(0x0d);													
tx(0x0d);
no_of_user=i2c_read(0,255);
delay(100);
if(no_of_user>1)
{					  
overwrite_condition=i2c_read(0,251);
delay(100);
tx_string("DATE        ROLL NUMBER        TIMINGS"); 
tx(0x0d);
if(overwrite_condition==0)
{				 
date_database_value=8;
for(u=0;u<date_database_value;u++)
{
for(b=1;b<no_of_user;b++)
{
for(t=(u*4);t<((u*4)+3);t++)
{
back_up_date=i2c_read(t,0);
delay(100);
tx((back_up_date/10)+0x30);
tx((back_up_date%10)+0x30);
if(t==((u*4)+2))
goto zmm;
tx('/');
zmm:
delay(1);
} 
tx_string("    ");
tx((b/10)+0x30);
tx((b%10)+0x30); 
tx_string("                 ");		  
back_up_time=i2c_read((u*4),b);
delay(100);				   
...

This file has been truncated, please download it to see its full contents.

Credits

Sumit Grover

Sumit Grover

8 projects • 31 followers

Comments