微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 嵌入式设计讨论 > MCU和单片机设计讨论 > 请大家帮忙看下哪里有问题,编译不了。

请大家帮忙看下哪里有问题,编译不了。

时间:10-02 整理:3721RD 点击:
#include<reg51.h>
#define uchar unsigned char;
#define uint unsigned int;
sbit S2=P3^4;
sbit S3=P3^5;
sbit S4=P3^6;
sbit S5=P3^7;
sbit dula=P2^6;
sbit wela=P2^7;
uchar i;
uchar code table[]=
{0x3f,0x06,0x5b,0x4f,
0x66,0x6d,0x7d,0x07,
0x7f,0x6f,0x77,0x7c,
0x39,0x5e,0x79,0x71};
void display(uchar i)
{
dula=1;
P0=table[i];
dula=0;
wela=1;
P0=0xfe;
wela=0;
}
void main()
{
if(S2==0)
  display(1);
if(S3==0)
  display(2);
if(S4==0)
  display(3);
if(S5==0)
  display(4);
}
编译提示:
17行,syntax error near‘;’

#define uchar unsigned char;#define uint unsigned int;这两句后面不要放分号

去掉分号
#define uchar unsigned char;
#define uint unsigned int;

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top