:\C语言\Cpp1.cpp(1) : fatal error C1083: Cannot open include file: 'reg51.h': No s
#include<reg51.h>#define uchar unsigned char
unsigned char code table[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82, 0xf8,0x80,0x90,0x88,0x83,0xc6,0xa1,0x86,0x8e};//数码管数字编码
uchar i,j,k,second,tcount,minute,hour,tminute,thour,ring;
sbit beep=P2^6;sbit S2=P3^4;
//---------------------------------------------------延时子程序,大约延时 n MS
delay(uchar n)
{
for(j=n;j>0;j--)
for(k=125;k>0;k--);
}
//---------------------------------------------------中断子程序
void timer0() interrupt 1 using 0
{
TH0=(65536-50000)/256; //中断设置初始化
TL0=(65536-50000)%256;
tcount++;
if(tcount==20) //满1秒
{tcount=0;second++;beep=0; //秒数加1
if(second==60) //满1分
{second=0;minute++; //分数加1,秒数归零
if(minute==60) //满1小时
{
minute=0;hour++; //小时数加1,分数归零
if(hour==24)
{hour=0;}
}
}
}
}
void timer1() interrupt 3 using 1
{
TH1=0x3c; //中断设置初始化
TL1=0xb0;
if(minute==tminute & hour==thour & ring==1) {beep=0;}//到预设时间自动响铃,持续一分钟后自己关闭
if(S2==0)
{
ring=0; //铃声中断
}
}
//---------------------------------------------------
void main()
{tminute=1;thour=0; //预置响铃时间
second=55;minute=0;hour=0; //给电子时钟赋初值,即启动时显示的时间
ring=1; //启动响铃功能
TH0=(65536-50000)/256; //中断设置初始化
TL0=(65536-50000)%256;
EA=1;ET0=1;TMOD=0x21;TR0=1; //开中断总开关,计数器0允许中断,设置中断模式,启动计数器0
ET1=1;TR1=1;
while(1) //死循环,进入显示,主要是动态显示原理
{
P0=table[(second%10)];
P2=0xdf;
delay(5);
P0=table[(second/10)];
P2=0xef;
delay(5);
P0=table[(minute%10)];
P2=0xf7;
delay(5);
P0=table[(minute/10)];
P2=0xfb;
delay(5);
P0=table[(hour%10)];
P2=0xfd;
delay(5);
P0=table[(hour/10)];
P2=0xfe;
delay(5);
}
} 对于编译时出现的这个错误:\C语言\Cpp1.cpp(1) : fatal error C1083: Cannot open include file: 'reg51.h': No such file or directory
执行 cl.exe 时出错.要怎么解决啊,拜托帮帮忙!