求大佬帮忙按着图里的要求改一下,万分感谢!
//AT89C51 LED控制
#include <reg51.h>
#include <intrins.h>
#define uint unsigned int
#define uchar unsigned char
unsigned char code SEG2[6]={0xfe,0xfd,0xfb,0xf7};
uchar t=0,x=0,y=0;
uchar a,b,c,d;
void delay(unsigned int i)
{
unsigned int j;
for(i;i>0;i--)
for(j=300;j>0;j--);
}
void zhongduan1()//50ms中断
{
EA=1;
ET0=1;
TMOD=0x01;
TH0=0x3c;
TL0=0xb0;
//TR0=1;
}
void zhongduan2()
{
EA=1;
EX0=1;
IT0=1;
EX1=1;
IT1=1;
}
void ledout(uchar out0,out1)//
{
if((20<=x&&x<25)&&(t>10))
{ P0=0;P1=0xff;delay(1);delay(1); }
else
{
P0=(out0)/10;
|