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/06/27 15:52:09
![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](/uploads/image/z/5907365-53-5.jpg?t=C+%E7%A8%8B%E5%BA%8F%E8%AF%B7%E9%AB%98%E6%89%8B%E7%9C%8B%E4%B8%8B%2C%E4%B8%BA%E4%BB%80%E4%B9%88%E5%87%BA%E7%8E%B0%E5%A6%82%E4%B8%8B%E9%94%99%E8%AF%AF%E2%80%A6%E2%80%A6%E6%84%9F%E8%B0%A2%21%23includesbit+KEY+%3D+P3%5E7%3Bsbit+LED+%3D+P1%5E7%3Bvoid+main%28void%29%7BP1M0+%3D+0X00%3B+%2F%2F0000+0000+1.7%2F1.6%2F1.5%2F1.4+1.3%2F1.2%2F1.1%2F1.0P1M1+%3D+0X00%3B+%2F%2F0000+0000+P3M0+%3D+0X80%3B+%2F%2F1000+0000P3M1+%3D+0X00%3B+%2F%2F0000+0000L)
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单片机的相关文件.单片机什么型号?我发给你.