Chinaunix首页 | 论坛 | 博客
  • 博客访问: 486515
  • 博文数量: 398
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 14
  • 用 户 组: 普通用户
  • 注册时间: 2013-08-21 16:02
个人简介

嵌入式屌丝

文章分类

全部博文(398)

文章存档

2013年(398)

我的朋友

分类: 嵌入式

2013-08-21 16:46:51

#include
static single=1;
static single1=1;
unsigned char smg[]={0xfe,0xfc,0xfd,0xf9,0xfb,0xf3,0xf7,0xf6};
void delay0()
{
   unsigned t=80;
   while(t--);
}
void delay1()       
{
   unsigned t=200;
   while(t--);
}
void main()
{  
   char i;
  TCON=0x05;
  IP=0x01;
  IE=0x85;
   
while(1)
{
if(single1==1)
{
  if(single==1)
  {
  for(i=0;i<8;i++)
    {
P1=smg[i];
delay0();
}
}
else
  {
  for(i=0;i<8;i++)
    {
P1=smg[i];
delay1();
}

         }
 else;
   }
}
   


void zd() interrupt 0 

  single=!single;
  
}
void zd1() interrupt 2 

  single1=!single1;
  
}
c:
.zip
阅读(474) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~