#includesbit d1=P1^0;sbit d2=P1^7;void timer0(void)interrup 1 using 1{d1=!d1;TH 0=(65536-50000)/256;TL 0=(65536-50000)%256;} void timer1(void) interrup 2 using 2{d2=!d2;} void main(void){TMOD=0x61;TH0 =(65536-50000)/256;TL0 =(65536-50000)%256;\x05TH1

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/23 10:38:36
#includesbitd1=P1^0;sbitd2=P1^7;voidtimer0(void)interrup1using1{d1=!d1;TH0=(65536-50000)/256;TL0=(65

#includesbit d1=P1^0;sbit d2=P1^7;void timer0(void)interrup 1 using 1{d1=!d1;TH 0=(65536-50000)/256;TL 0=(65536-50000)%256;} void timer1(void) interrup 2 using 2{d2=!d2;} void main(void){TMOD=0x61;TH0 =(65536-50000)/256;TL0 =(65536-50000)%256;\x05TH1
#include
sbit d1=P1^0;
sbit d2=P1^7;
void timer0(void)interrup 1 using 1
{
d1=!d1;
TH 0=(65536-50000)/256;
TL 0=(65536-50000)%256;
}
void timer1(void) interrup 2 using 2
{
d2=!d2;
}
void main(void)
{
TMOD=0x61;
TH0 =(65536-50000)/256;
TL0 =(65536-50000)%256;\x05
TH1 =256-5;
TL1 =256-5;
IP=0x08;
EA=1;
ET0 =1;
ET1 =1;
TR0 =1;
TR1 =1;
for(;;) {}
}
Build target 'Target 1'
compiling Text1.C...
TEXT1.C(4):error C132:'interrup':not in formal parameter list
TEXT1.C(4):error C141:syntax error near '1'
TEXT1.C(6):error C244:'d1':can't initialize,bad type or class
TEXT1.C(6):error C132:'d1':not in formal parameter list
TEXT1.C(7):error C132:'TH':not in formal parameter list
TEXT1.C(7):error C141:syntax error near '0'
TEXT1.C(8):error C132:'TL':not in formal parameter list
TEXT1.C(10):error C132:'timer1':not in formal parameter list
TEXT1.C(10):error C141:syntax error near 'interrup'
TEXT1.C(10):error C132:'interrup':not in formal parameter list
TEXT1.C(12):error C244:'d2':can't initialize,bad type or class
TEXT1.C(12):error C132:'d2':not in formal parameter list
TEXT1.C(13):error C141:syntax error near '}'
Target not created

#includesbit d1=P1^0;sbit d2=P1^7;void timer0(void)interrup 1 using 1{d1=!d1;TH 0=(65536-50000)/256;TL 0=(65536-50000)%256;} void timer1(void) interrup 2 using 2{d2=!d2;} void main(void){TMOD=0x61;TH0 =(65536-50000)/256;TL0 =(65536-50000)%256;\x05TH1
void timer0(void)interrup 1 using 1中,“interrup ”应为interrupt