123456. 发表于 2021-11-13 12:21:23

无法烧录到开发板上

#include<reg51.h>
unsigned char code discode1[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
unsigned char code discode2[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
unsigned char timer=0;
unsigned char second;
unsigned char key=0;
main()
{
        TMOD=0x01;
        ET0=1;
        EA=1;
        second=0;
        P0=discode1;
        P0=discode2;
        while(1)
        {
                if((P3&0x80)==0x00)
                {
                        key++;
                  switch(key)
          {
                                case 1:
                                        TH0=0xee;
                                        TL0=0x00;
                                        TR0=1;
                                        break;
                                case 2:
                                        TR0=0;
                                        break;
                                case 3:
                                        key=0;
                                        second=0;
                                        P0=discode1;
                                        P0=discode2;
                                        break;
                        }
      while((P3&0x80)==0x00);
                }
        }
}
void int_T0() interrupt 1 using 0
{                       
        TR0=0;
        TH0=0xee;
        TL0=0x00;
        timer++;
        if (timer==200)
        {
                timer=0;
                second++;
                P0=discode1;
                P0=discode2;
        }
          if(second==60)
                {
                        TR0=0;
          second=0;
                        key=2;
                }
       else
       {
               TR0=1;
       }
}

123456. 发表于 2021-11-13 12:23:05

这是开发板

本帖最后由 123456. 于 2021-11-13 12:24 编辑

这是我的开发板
页: [1]
查看完整版本: 无法烧录到开发板上