资源描述:
《单片机抢答器 原件清单&原理图&仿真图&C语言程序》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、附录3 元件明细表项目代号代号名称、型号、规格数量备注更改电阻器8R0GB8551-87RT―0.125―b―510Ω―±10%1R1GB8551-87RT―0.125―b―510Ω―±10%1R2GB8551-87RT―0.125―b―510Ω―±10%1R3GB8551-87RT―0.125―b―510Ω―±10%1R4GB8551-87RT―0.125―b―510Ω―±10%1R5GB8551-87RT―0.125―b―510Ω―±10%1R6GB8551-87RT―0.125―b―510Ω―±10%1R7GB8551-87RT―0.125―b―510Ω―±10%1R
2、pA103J1k排阻1电容器3C1,C2GB5995-86CD-2-10V-30pF-±102C3GB5995-86CD-2-25V-100μF-±101单片机1C52AT89C52AT89C52-24AI1数码管1LED0SM410364SM410364LED1发光二极管2LED1SJ1067-76LJ-204d-21红色LED2SJ1067-76LJ-204d-21绿色蜂鸣器1V3YMD-12095YMD-12095-B1按键开关17K0-k10PS2213APS2213A12石英晶振1K12K12.000K12.0001三极管90131旧底图总号更改标记数量更改单号签
3、名日期底图总号拟制邹君串联型直流稳压电源元件表审校邹君日期签名等级标记第2张共2张标准化批准#include#include#defineucharunsignedchar#defineuintunsignedintsbitP2_4=P2^4;sbitP3_4=P3^4;sbitP3_5=P3^5;sbitP3_7=P3^7;ucharled[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};ucharduan[]={0xf1,0xf2,0xf4,0xf8};ucharh;uc
4、harflag1,flag2,flag3;uintcount,sec=30;voidjianpan();voidbuzzer(uinti,uintj);voiddelay(intj){inti;for(i=j;i>0;i--);}voiddisplay(uchard,ucharw){intj;for(j=0;j<4;j++){P2=duan[d];P0=led[w/10];jianpan();P2=duan[d+1];P0=led[w%10];jianpan();}}voidjianpan(){uchari,n,m,b=0x01;for(i=0;i<4;i++){P1=~b
5、;delay(20);n=P1;if(n!=b)if(flag3==1){switch(n){case0xee:flag1=1;flag3=0;sec=60;P3_5=0;P3_4=1;buzzer(1,100);break;case0xde:flag1=2;flag3=0;sec=60;P3_5=0;P3_4=1;buzzer(1,100);break;case0xbe:flag1=3;flag3=0;sec=60;P3_5=0;P3_4=1;buzzer(1,100);break;case0x7e:flag1=4;flag3=0;sec=60;P3_5=0;P3_4=1
6、;buzzer(1,100);break;case0xed:flag1=5;flag3=0;sec=60;P3_5=0;P3_4=1;buzzer(1,100);break;case0xdd:flag1=6;flag3=0;sec=60;P3_5=0;P3_4=1;buzzer(1,100);break;case0xbd:flag1=7;flag3=0;sec=60;P3_5=0;P3_4=1;buzzer(1,100);break;case0x7d:flag1=8;flag3=0;sec=60;P3_5=0;P3_4=1;buzzer(1,100);break;case0
7、xeb:flag1=9;flag3=0;sec=60;P3_5=0;P3_4=1;buzzer(1,100);break;case0xdb:flag1=10;flag3=0;sec=60;P3_5=0;P3_4=1;buzzer(1,100);break;case0xbb:flag1=11;flag3=0;sec=60;P3_5=0;P3_4=1;buzzer(1,100);break;case0x7b:flag1=12;flag3=0;sec=60;P3_5=0;P3_4=1;buzzer(1,100);P3_7