www.pudn.com > TELEPHONE.rar > LED_DIS.c, change:2008-04-26,size:4255b


#include<reg52.h>  
#include <intrins.h> 
#include"type.h" 
#include"LED_DIS.H" 
void delay(UINT t) 
{ 
	UCHAR i; 
	while(t--) 
	{ 
		for(i=0;i<10;i++); 
	} 
 
} 
void switch_DIS(UCHAR S_DAT) 
{ 
		switch(S_DAT) 
	{ 
			case 0: 
		{	 
			LED_DIS_D0=0; 
			LED_DIS_D1=0; 
			LED_DIS_D2=0; 
			LED_DIS_D3=0; 
		 
		 } break; 
		 case 1: 
		{	 
			LED_DIS_D0=1; 
			LED_DIS_D1=0; 
			LED_DIS_D2=0; 
			LED_DIS_D3=0; 
		 
		 } break; 
		 case 2: 
		{	 
		 
			LED_DIS_D0=0; 
			LED_DIS_D1=1; 
			LED_DIS_D2=0; 
			LED_DIS_D3=0; 
			 
		 } break; 
		 case 3: 
		{	 
		 
			LED_DIS_D0=1; 
			LED_DIS_D1=1; 
			LED_DIS_D2=0; 
			LED_DIS_D3=0; 
			 
		 } break; 
		 case 4: 
		{	 
		 
			LED_DIS_D0=0; 
			LED_DIS_D1=0; 
			LED_DIS_D2=1; 
			LED_DIS_D3=0; 
			 
		 } break; 
		 case 5: 
		{	 
				 
		 
			LED_DIS_D0=1; 
			LED_DIS_D1=0; 
			LED_DIS_D2=1; 
			LED_DIS_D3=0; 
		 
		 } break; 
		 case 6: 
		{	 
			 
			LED_DIS_D0=0; 
			LED_DIS_D1=1; 
			LED_DIS_D2=1; 
			LED_DIS_D3=0; 
		 
		 } break; 
		 case 7: 
		{	 
			LED_DIS_D0=1; 
			LED_DIS_D1=1; 
			LED_DIS_D2=1; 
			LED_DIS_D3=0; 
			 
		 } break; 
		 case 8: 
		{	 
		 
			LED_DIS_D0=0; 
			LED_DIS_D1=0; 
			LED_DIS_D2=0; 
			LED_DIS_D3=1; 
			 
		 } break; 
		 case 9: 
		{	 
		 
			LED_DIS_D0=1; 
			LED_DIS_D1=0; 
			LED_DIS_D2=0; 
			LED_DIS_D3=1; 
		 
		 } break; 
		 default:break; 
		 	 
	 
	} 
} 
void LED_DIS(UCHAR LED_DSI_DAT) 
{ 
	UCHAR DIS_DAT0,DIS_DAT1; 
 
	DIS_DAT0=LED_DSI_DAT/10; 
	DIS_DAT1=LED_DSI_DAT%10; 
				 
	LED_DIS_A0=0; 
	LED_DIS_A1=1; 
	switch_DIS(DIS_DAT0); 
	delay(5); 
	LED_DIS_A0=1; 
	LED_DIS_A1=0; 
	switch_DIS(DIS_DAT1); 
	delay(5); 
	/*	case 0: 
		{	 
			LED_DIS_D0=0; 
			LED_DIS_D1=0; 
			LED_DIS_D2=0; 
			LED_DIS_D3=0; 
			LED_DIS_A0=0; 
			LED_DIS_A1=0; 
		 } break; 
		 case 1: 
		{	 
			LED_DIS_D0=0; 
			LED_DIS_D1=0; 
			LED_DIS_D2=0; 
			LED_DIS_D3=0; 
			LED_DIS_A0=0; 
			LED_DIS_A1=1; 
			delay(1); 
			LED_DIS_A0=1; 
			LED_DIS_A1=0; 
			LED_DIS_D0=1; 
			LED_DIS_D1=0; 
			LED_DIS_D2=0; 
			LED_DIS_D3=0; 
			delay(1); 
		 } break; 
		 case 2: 
		{	 
			LED_DIS_D0=0; 
			LED_DIS_D1=0; 
			LED_DIS_D2=0; 
			LED_DIS_D3=0; 
			LED_DIS_A0=0; 
			LED_DIS_A1=1; 
			delay(1); 
			LED_DIS_A0=1; 
			LED_DIS_A1=0; 
			LED_DIS_D0=0; 
			LED_DIS_D1=1; 
			LED_DIS_D2=0; 
			LED_DIS_D3=0; 
			delay(1); 
		 } break; 
		 case 3: 
		{	 
			LED_DIS_D0=0; 
			LED_DIS_D1=0; 
			LED_DIS_D2=0; 
			LED_DIS_D3=0; 
			LED_DIS_A0=0; 
			LED_DIS_A1=1; 
			delay(1); 
			LED_DIS_A0=1; 
			LED_DIS_A1=0; 
			LED_DIS_D0=1; 
			LED_DIS_D1=1; 
			LED_DIS_D2=0; 
			LED_DIS_D3=0; 
			delay(1); 
		 } break; 
		 case 4: 
		{	 
			LED_DIS_D0=0; 
			LED_DIS_D1=0; 
			LED_DIS_D2=0; 
			LED_DIS_D3=0; 
			LED_DIS_A0=0; 
			LED_DIS_A1=1; 
			delay(1); 
			LED_DIS_A0=1; 
			LED_DIS_A1=0; 
			LED_DIS_D0=0; 
			LED_DIS_D1=0; 
			LED_DIS_D2=1; 
			LED_DIS_D3=0; 
			delay(1); 
		 } break; 
		 case 5: 
		{	 
				 
			LED_DIS_D0=0; 
			LED_DIS_D1=0; 
			LED_DIS_D2=0; 
			LED_DIS_D3=0; 
			LED_DIS_A0=0; 
			LED_DIS_A1=1; 
			delay(1); 
			LED_DIS_A0=1; 
			LED_DIS_A1=0; 
			LED_DIS_D0=1; 
			LED_DIS_D1=0; 
			LED_DIS_D2=1; 
			LED_DIS_D3=0; 
			delay(1); 
		 } break; 
		 case 6: 
		{	 
			LED_DIS_D0=0; 
			LED_DIS_D1=0; 
			LED_DIS_D2=0; 
			LED_DIS_D3=0; 
			LED_DIS_A0=0; 
			LED_DIS_A1=1; 
			delay(1); 
			LED_DIS_A0=1; 
			LED_DIS_A1=0; 
			LED_DIS_D0=0; 
			LED_DIS_D1=1; 
			LED_DIS_D2=1; 
			LED_DIS_D3=0; 
			delay(1); 
		 } break; 
		 case 7: 
		{	LED_DIS_D0=0; 
			LED_DIS_D1=0; 
			LED_DIS_D2=0; 
			LED_DIS_D3=0; 
			LED_DIS_A0=0; 
			LED_DIS_A1=1; 
			delay(1); 
			LED_DIS_A0=1; 
			LED_DIS_A1=0; 
			LED_DIS_D0=1; 
			LED_DIS_D1=1; 
			LED_DIS_D2=1; 
			LED_DIS_D3=0; 
			delay(1); 
		 } break; 
		 case 8: 
		{	 
			LED_DIS_D0=0; 
			LED_DIS_D1=0; 
			LED_DIS_D2=0; 
			LED_DIS_D3=0; 
			LED_DIS_A0=0; 
			LED_DIS_A1=1; 
			delay(1); 
			LED_DIS_A0=1; 
			LED_DIS_A1=0; 
			LED_DIS_D0=0; 
			LED_DIS_D1=0; 
			LED_DIS_D2=0; 
			LED_DIS_D3=1; 
			delay(1); 
		 } break; 
		 case 9: 
		{	 
			LED_DIS_D0=0; 
			LED_DIS_D1=0; 
			LED_DIS_D2=0; 
			LED_DIS_D3=0; 
			LED_DIS_A0=0; 
			LED_DIS_A1=1; 
			delay(1); 
			LED_DIS_A0=1; 
			LED_DIS_A1=0; 
			LED_DIS_D0=1; 
			LED_DIS_D1=0; 
			LED_DIS_D2=0; 
			LED_DIS_D3=1; 
			delay(1); 
		 } break;	  */ 
	 
	 
		 
}