《电力智能化控制实验.docx》由会员分享,可在线阅读,更多相关《电力智能化控制实验.docx(12页珍藏版)》请在第一文库网上搜索。
1、学号:#includeunsignedcharTab=03fz0x06,0x5b,0x4f,0x66,06d,07d,0x07,0x7f,0x6f;int i=0;void delay(int ms)(int ij;for(i=0;ims;i+)(for(j=0;j110;j+);void main(void)(TMOD=0x01;TH0=(65536-1000)/256;TL0=(65536-1000)%256;EA=1;ETO=1;TRO=1;while(l)void timeO(void) interrupt 1(TH0=(65536-1000)/256;TL0=(65536-1000)
2、%256;delay(l);switch(i)(case 0:P2=0XFE;P0=Tab5;break;case l:P2=0XFD;P0=Tab3;break;case 2:P2=0XFB;P0=Tab2;break;case 3:P2=0XF7;P0=Tab0;break;case 4:P2=0XEF;P0=Tab0;break;case 5:P2=0XDF;P0=Tab2;break;case 6:P2=0XBF;P0=Tab0;break;case 7:P2=0X7F;P0=Tab6;break;)i+;if(i=8)i=0; 8xe hao - Proteuv 8 Professi
3、onal -文WF) ifi明D ffiV) IJKT)图*G) iD) l)型妮(Y)帮助(H)db- tste4QQ s:g : o b 老g 母 q 、, 吟1%U 、巴.:. I Q 6Messrs)显示当前找岐元件按键#includevoid main(void)(while(l)P2=OXFE;if(P2=0XF6)Pl=0X06;)else if(P2=0XEE)(Pl=0X5B;)else if(P2=0XDE)(Pl=0X4F;)P2=0XFD;if(P2=0XF5)(Pl=0X66;)else if(P2=0XED)(Pl=0X6D;else if(P2=0XDD)Pl=0
4、X7D;)P2=0XFB;jf(P2=0XF3)Pl=0X07;)else if(P2=0XEB)(Pl=0X7F;)else if(P2=0XDB)(Pl=0X6F;)A 8a jian - Proteus 8 Professional -剽忸堆制文阚力 AM(E) ffl(V) u iftit(N BW(G) D)际(1) Mtf(M) MY)乐助(H) C t8国点4Q雷图回 O BaD”Si:米中国 e N 吟/ ,.物画*上 Q i,岩if(Pl=0XF6)| !AT89CS1BUTTON1jTAL1l-XTAL2A l II 勘 5Ms”9ehwRSTP1.0P1.1P1.2P1.
5、3P1.4P1.5P1.6P1.7AT89C51P0.0AD0P0 1AD1P0.2AD2P0.3AD3P0.4AD4P0.5AD5P0.6AD6P0.7AD739100Q01000PSENALEEA2223242526P2.0A8P2.1A9P2.2A10P2.3A11P2.4A12P2.5A13P2.6A14P2.7A15P3.0RXDP3.1TXDP3.2iNT0P3.aiNT1P3.4T0P3.5T1P3.6RP3.7RD-J-C O-#includevoid main(void)(char i;SCON=0X40;TMOD=0X20;TH1=OXE6;TL1=OXE6;TR1=1;w
6、hile(l)(P1=OXFE;i=0X3F;)else if(Pl=OXEE)(i=0X06;)else if(Pl=OXDE)(i=0X5B;SBUF=i;while(TI=0);TI=0;)#includevoid main(void)(char i;SCON=0X50;TMOD=0X20;TH1=OXE6;TL1=OXE6;TR1=1;while(l)(while(RI)(i=SBUF;RI=O;)Pl=i; sy6 Proteus 8 Professional (RWJ文仲(F) CE)於B(V) TRO) lftltN) 0E(G) (D)库(D (M)浜统(Y) 向茎依囱正口 )
7、 B*39n二上三4+,。 Q- ?f ,,验 L 玄/ 甯 AN X : * GSA 论nsAT89C51BUTTONCAPCRYSTALDPSWC.8OPSWC3IEQREOAES,3“3F2JMIIF23*J1*UF2MUrZAA14nt*tP23F2M”a*wn4*13F21MP2ftA14miM0*羁*&主工M2CO.O*7000.0 cA |. u 任”:稣6。Root she! 光敏:#includesbit P20=P20jsbit P21=P21jsbit P22=P22jvoid main(void)(TMOD=0x01;TH0=(65536-100)/256;TL0=(65536-100)%256;EA=1;ETO=1;while(l)if(P21=l)TRO=1;P22=0;)else(TRO=O;P22=l;)void timeO(void) interrupt 1(TH0=(65536-100)/256;TL0=(65536-100)%256;P20=P20;