C 程序请高手看下,为什么出现如下错误……感谢!#includesbit KEY = P3^7;sbit LED = P1^7;void main(void){P1M0 = 0X00; //0000 0000 1.7/1.6/1.5/1.4 1.3/1.2/1.1/1.0P1M1 = 0X00; //0000 0000 P3M0 = 0X80; //1000 0000P3M1 = 0X00; //0000 0000L
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/18 16:15:41
C 程序请高手看下,为什么出现如下错误……感谢!#includesbit KEY = P3^7;sbit LED = P1^7;void main(void){P1M0 = 0X00; //0000 0000 1.7/1.6/1.5/1.4 1.3/1.2/1.1/1.0P1M1 = 0X00; //0000 0000 P3M0 = 0X80; //1000 0000P3M1 = 0X00; //0000 0000L
C 程序请高手看下,为什么出现如下错误……感谢!
#include
sbit KEY = P3^7;
sbit LED = P1^7;
void main(void){
P1M0 = 0X00; //0000 0000 1.7/1.6/1.5/1.4 1.3/1.2/1.1/1.0
P1M1 = 0X00; //0000 0000
P3M0 = 0X80; //1000 0000
P3M1 = 0X00; //0000 0000
LED = 1; //P1.7
KEY = 0;//P3.7
while(1){
LED = KEY;
}
}
错误如下;
Build target 'Target 1'
assembling STARTUP.A51...
compiling 328.c...
328.C(10):error C202:'P1M0':undefined identifier
328.C(11):error C202:'P1M1':undefined identifier
328.C(12):error C202:'P3M0':undefined identifier
328.C(13):error C202:'P3M1':undefined identifier
Target not created
C 程序请高手看下,为什么出现如下错误……感谢!#includesbit KEY = P3^7;sbit LED = P1^7;void main(void){P1M0 = 0X00; //0000 0000 1.7/1.6/1.5/1.4 1.3/1.2/1.1/1.0P1M1 = 0X00; //0000 0000 P3M0 = 0X80; //1000 0000P3M1 = 0X00; //0000 0000L
P1M0,P1M1,P3M0,P3M1 是STC单片机专用的特殊功能寄存器,必须在编译器内增加STC单片机的相关文件.单片机什么型号?我发给你.