#ifndef __led__H_
#define __led__H_

#include "lcd1602.h"
#include<intrins.h>

#define uchar unsigned char
#define uint unsigned int


uchar code runledcode[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f,0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe};



//*******************************头文件

		   

sbit LEDSWITCH=P2^0;
 
 uchar c=0;
 uchar d=0;			//定义变量


//*******************************毫秒级延时函数




//*******************************主函数



void ledflash()
{
 static bit ledflag=0;
 LEDSWITCH=0;
 ledflag=~ledflag;
 if(ledflag)
  {
   P0=0x00;
  }
  else
  {
   P0=0xff;  
  }
}





void ledrunstar()
{
   static uchar run=0;

	LEDSWITCH=0;							//打开LED开关   低电平有效	   								       

	P0=runledcode[run];

	run++;
	if(run==16)
	   run=0;
			
}




#endif

