警告如下:
missing';'before sz
单片机源码如下:
#include <REG52.H>
#include "intrins.h"
int x;
sbit d6=P2^6;
sbit d5=P2^5;
sbit d4=P2^4;
byte[8] sz=={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};
BYTE code sz1[]={0x35,0xAD,0xAD,0x98,0x0D,0x6B,0x08,0xFD};//×£
BYTE code sz2[]={0x99,0x5A,0x00,0xFF,0x16,0x55,0x10,0xFD};//oØ
BYTE code sz3[]={0x00,0xDB,0xC3,0xDB,0xC3,0x7E,0x00,0xE7};//òË
BYTE code sz4[]={0xBD,0xDB,0x00,0xEB,0xC3,0x5E,0x00,0xE7};//±ö
BYTE code sz5[]={0xEF,0x2D,0x6D,0x6D,0x01,0xEF,0x01,0xC7};//êD
BYTE code sz6[]={0x81,0xED,0x81,0xAF,0x81,0xFF,0xAA,0x99};//μú
BYTE code sz7[]={0xEF,0xEF,0xEF,0x01,0xEF,0xEF,0xEF,0xFF};//ê®
BYTE code sz8[]={0x82,0xAA,0xAA,0x82,0xEE,0x00,0x7E,0x00};//½ì
BYTE code sz9[]={0xEF,0xEF,0xEF,0x01,0x6D,0x01,0xEF,0xEF};//ÖD
BYTE code sz10[]={0xF7,0x50,0x55,0xF1,0x15,0x51,0x15,0xE0};//Ö°
BYTE code sz11[]={0xEF,0xEF,0x03,0xEF,0xDF,0x45,0x01,0xAB};//ѧ
BYTE code sz12[]={0x01,0xEF,0xEF,0x01,0xEF,0x01,0xEB,0xEF};//éú
BYTE code sz13[]={0xAD,0xAD,0xDD,0xA8,0x8D,0xD8,0x8D,0xDD};//¼¼
BYTE code sz14[]={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};//Äü
BYTE code sz15[]={0x7D,0xBB,0xD7,0xD7,0xEF,0x01,0xEF,0xEF};//′ó
BYTE code sz16[]={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};//èü
BYTE code sz17[]={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};//è¡
BYTE code sz18[]={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};//μÃ
BYTE code sz19[]={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};//Ô°
BYTE code sz20[]={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};//Âú
BYTE code sz21[]={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};//3é
BYTE code sz22[]={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};//1|
void ys (int q)
{
int w;
for (;q>0;q--)
for(w=0;w<115;w++);
}
void hc595 (char bat)
{
char w;
d6=0;
d5=0;
for(w=0;w<8;w++)
{
d4=bat>>7;
bat<<=1;
d6=1;
_nop_();
d6=0;
}
d5=1;
_nop_();
_nop_();
d5=0;
}
void sf ()
{
char p;
switch (x)
{
case 1:
for(p=0;p<8;p++)
{
hc595 (sz[p]);
P1=sz1[p];
ys(1);
P1=0xff;
break;
}
case 3:
for(p=0;p<8;p++)
{
hc595 (sz[p]);
P1=sz2[p];
ys(1);
P1=0xff;
break;
}
case 5:
for(p=0;p<8;p++)
{
hc595 (sz[p]);
P1=sz3[p];
ys(1);
P1=0xff;
break;
}
case 7:
for(p=0;p<8;p++)
{
hc595 (sz[p]);
P1=sz4[p];
ys(1);
P1=0xff;
break;
}
case 9:
for(p=0;p<8;p++)
{
hc595 (sz[p]);
P1=sz5[p];
ys(1);
P1=0xff;
break;
}
case 11:
for(p=0;p<8;p++)
{
hc595 (sz[p]);
P1=sz6[p];
ys(1);
P1=0xff;
break;
}
case 13:
for(p=0;p<8;p++)
{
hc595 (sz[p]);
P1=sz7[p];
ys(1);
P1=0xff;
break;
}
case 15:
for(p=0;p<8;p++)
{
hc595 (sz[p]);
P1=sz8[p];
ys(1);
P1=0xff;
break;
}
case 17:
for(p=0;p<8;p++)
{
hc595 (sz[p]);
P1=sz9[p];
ys(1);
P1=0xff;
break;
}
case 19:
for(p=0;p<8;p++)
{
hc595 (sz[p]);
P1=sz10[p];
ys(1);
P1=0xff;
break;
}
case 21:
for(p=0;p<8;p++)
{
hc595 (sz[p]);
P1=sz11[p];
ys(1);
P1=0xff;
break;
}
case 23:
for(p=0;p<8;p++)
{
hc595 (sz[p]);
P1=sz12[p];
ys(1);
P1=0xff;
break;
}
}
}
void Timer0Init(void) //20??@11.0592MHz
{
TMOD = 0x01;
TL0 = 0x00; //??????
TH0 = 0xB8;
TF0 = 0; //??TF0??
TR0 = 1; //???0????
EA=1;
}
void main()
{
Timer0Init();
while(1)
{
sf();
}
}
void tm0_isr() interrupt 1 using 1
{
int y,s;
TL0 = 0xEE; //??????
TH0 = 0xFF; //??????
y++;
if(y==25)
{
y=0;
s++;
if(s%2)
{
x++;
}
}
}
|