#include<reg52.h>
#include<stdio.h>
#include<stdlib.h>
sbit k1=P3^4;
sbit k2=P3^5;
sbit k3=P3^6;
sbit k4=P3^7;
sbit beep=P2^3;
sbit dula=P2^6;
sbit wela=P2^7;
unsigned char T,num,m;
unsigned char code w[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf};
unsigned char code d[]={0x06,0x5b,0x4f,0x66,0x6d,0x7d};
unsigned char L[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
void delay(unsigned int i)
{
unsigned int j;
unsigned char k;
for(j=i;j>0;j--)
for(k=125;k>0;k--);
}
void main()
{
while (1)
{
if (k1=~k1)
num=1;
else if (k2=~k2)
num=2;
else (k3=~k3)
num=3;
swich(num)
{ case 1: pmd();break;
case 2: smg();break;
case 3: fmq();break;
default:break;
}
if(k4=~lk4)
return (num=4);
}
}
void pmd()
{
while(1)
{
unsigned char m;
for(m=0;m<8;m++)
{
P1 = 0xff;
delay(2000);
P1=L[m];
delay(2000);
}
}
}
void smg()
{
unsigned char num;
TMOD = 0x01;
TH0 = 0xfe;
TL0 = 0xfe;
EA = 1;
ET0 = 1;
TR0 = 1;
while(1)
{
for(num=0;num<6;num++)
{
P0=w[num];
wela=1;
wela=0;
P0=d[num];
dula=1;
dula=0;
while(1)
{
if(T == 1)
{
T = 0;
break;
}
}
}
}
}
void fmq()
{
while(1)
{
if(k3=~k3)
beep=0;
else
beep=1;
}
}
void Timer0() interrupt 1
{
TH0 = 0xfe;
TL0 = 0xfe;
T++;
}
点击build后就是这个鬼:Build target 'Target 1'
compiling an jian.c...
Target not created
哪里出错了啊?创建project的时候没问题,我觉得应该是程序问题!!
|