#include <REGX52.H>
#include "Delay.h"
#include "MatrixLED.h"
#define uchar unsigned char
#define uint unsigned int
sbit buzz=P2^5;//???
sbit key1=P2^7;//??
bit start; //???????
uchar num; //21?????
uint timer,index=0; //?????,?????
uchar beat;
code uchar gequ[]={120,116,117,211,212,117,211,221,
211,117,211,212,117,211,221,211,212,213,212,213,212,223,
213,212,223,225,223,116,117,211,212,117,211,221,211,117,
211,212,117,211,221,211,212,213,212,213,212,223,213,212,
223,225,223,225,233,215,233,215,213,215,216,213,225,225,
233,215,233,215,213,215,216,213,225,215,215,213,212,222,
222,211,213,213,212,222,222,211,211,146,110,215,215,213,
212,222,222,211,213,213,212,222,222,211,211,146,140,0};
code uint pinlv[]={466,523,587,659,698,784,880,//??
932,1047,1175,1319,1397,1568,1760,//??
1865,2094,2351,2633,2792,3134,3517};
unsigned char code xiayi[]={
0x7E,0x81,0x80,0x80,0x80,0x80,0x81,0x7E,0x00,
0x49,0x49,0x49,0xEB,0x49,0x49,0x49,0x91,0x00,
0x81,0x62,0x14,0x08,0x08,0x7F,0x08,0x08,0x00,
0x18,0x08,0x3E,0x08,0x1C,0x41,0xFF,0x4A,0x00,
0x11,0x0A,0xAA,0x44,0xA4,0xF1,0x0F,0x04,0x00,
0xFF,0x84,0xA5,0xB7,0xA5,0xA1,0xD7,0x40,0x00,
0x7E,0x81,0x80,0x80,0x80,0x80,0x81,0x7E,0x00,
0x18,0x28,0x08,0x08,0x08,0x08,0x08,0x7E,0x00,
0x18,0x28,0x08,0x08,0x08,0x08,0x08,0x7E,0x00,
};unsigned char code shangyi[]={
0x18,0x28,0x08,0x08,0x08,0x08,0x08,0x7E,0x00,
0x18,0x28,0x08,0x08,0x08,0x08,0x08,0x7E,0x00,
0x7E,0x81,0x80,0x80,0x80,0x80,0x81,0x7E,0x00,
0xFF,0x84,0xA5,0xB7,0xA5,0xA1,0xD7,0x40,0x00,
0x11,0x0A,0xAA,0x44,0xA4,0xF1,0x0F,0x04,0x00,
0x18,0x08,0x3E,0x08,0x1C,0x41,0xFF,0x4A,0x00,
0x81,0x62,0x14,0x08,0x08,0x7F,0x08,0x08,0x00,
0x91,0x49,0x29,0x29,0xBB,0x29,0x29,0x29,0x00,
0x7E,0x81,0x80,0x80,0x80,0x80,0x81,0x7E,0x00,
};
void delay (uchar t);
void play();
void main()
{
unsigned char i,Offset=0,Count=0;
MatrixLED_Init();
while(1)
{if(P3_0==0){
while(1)
{
for(i=0;i<8;i++) //循环8次,显示8列数据
{
MatrixLED_ShowColumn(i,shangyi[72+i-Offset]);
}
Count++; //计次延时
if(Count>15)
{
Count=0;
Offset+=1; //偏移+1,逐帧移动
if(Offset>72)
{
Offset=0;
}}
}
}
if(P3_1==0){
while(1)
{
for(i=0;i<8;i++) //循环8次,显示8列数据
{
MatrixLED_ShowColumn(i,xiayi[i+Offset]);
}
Count++; //计次延时
if(Count>15)
{
Count=0;
Offset+=1; //偏移+1,逐帧移动
if(Offset>72)
{
Offset=0;
}
}}
}
if(P3_2==0){
while(1)
{
for(i=0;i<8;i++) //循环8次,显示8列数据
{
MatrixLED_ShowColumn(i,xiayi[i+Offset]);
}
Count++; //计次延时
if(Count>64)
{
Count=0;
Offset+=9; //偏移+9,定格移动
if(Offset>72)
{
Offset=0;
}
}}
};
void play()
{
while(gequ[index]) //???????????????????
{
if(gequ[index]%10==0) //?????????????0,?????
TR0=0; // ??120
else
{
num=gequ[index]%10+(gequ[index]/100-1)*7-1;//????????????
timer=65536-(11059200/12)/(pinlv[num]*2);//????????
TH0=timer/256;
TL0=timer%256;
TR0=1;
}
beat=gequ[index]/10%10; //??????????
delay(beat);
index++; //?????????1
}
TR0=0; //????????
index=0; //????????????
};
}
}
报错main.c(107): error C141: syntax error near 'void', expected '__asm'
main.c(108): error C141: syntax error near '{', expected ';'