#include<reg51.h>
#include<absacc.h>
#define uchar unsigned char
#define uint unsigned int
#define com XBYTE[0x 7f00]
#define pa XBYTE[0x 7f01]
#define pb XBYTE[0x 7f02]
#define pc XBYTE[0x 7f03]
#define led1 P1
#define led2 P2
sbit iom=P1^7;
uchar table[]={0xc0,0xf9,0x24,0x30,0x19,0x12,0x02,0x78,0x00,0x18,0x08,0x03,0x46,0x21,0x06,0x0e,0x7f};
bit press()
uchar read()
uchar display(uchar row)
void delay(uint xms)
{
uint i,j;
for(i=xms;i>0;i--)
for(j=110;j>0;j--);
}
bit press()
{
uchar hang;
pc=0x00;
hang=pa;
if(hang!=0xff)
return(1);
else
return(0);
}
uchar read()
{
uint t;
uchar hang,lie,keyscan,j,value;
value=0x00;
if(press()==1)
{
delay(10)
if(press()==1)
{
hang=0xfe;
for(t=0;t<4;t++)
{
pc=hang;
lie=pa;
if(lie!=0xff)
{
for(j=0;j<8;j++)
{
if((lie&0x01)!=0x01)
{
keyscan=j+value;
return(keyscan);
}
else
{
lie>>1;
}
}
else
{
hang=(hang<<1)|0x01;
value+=0x08;
}
}
}
return(0xff);
}
return(0xff);
}
}
uchar display(uchar row)
{
uchar row1,row2;
if(row==0xff)
{
led1=table[16];
led2=table[16];
}
else
{
row1=row/10;
row2=row%10;
led1=table[row1];
led2=table[row2];
}
}
void main()
{
uchar row3;
iom=1;
com=0x0c;
while(1)
{
row3=read();
display(row3);
while(press());
delay(50);
}
}
通过KEIL编译后出现这样的错误提示,请各位大侠帮忙看看问题出在哪里?
A.C(15): error C132: 'read': not in formal parameter list
A.C(15): error C141: syntax error near 'unsigned'
A.C(17): error C132: '_display': not in formal parameter list
A.C(17): error C141: syntax error near 'void'
A.C(18): error C132: '_delay': not in formal parameter list
A.C(18): error C141: syntax error near '{'
A.C(19): error C132: 'i': not in formal parameter list
A.C(19): error C132: 'j': not in formal parameter list
A.C(20): error C141: syntax error near 'for'
A.C(20): error C141: syntax error near '=', expected ')'
A.C(20): error C129: missing ';' before '>'
a.c - 11 Error(s), 0 Warning(s).
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
我是想用8155芯片搞个阵列键盘的
一周热门 更多>