51单片机小项目电路TwoLed电路图
1.复位电路没有开关,不可控
在电容旁边并联一个开关和10k的电阻支路
2.晶振电路引用的外部晶振,
理论上XTAL2悬空,XTAL1接外部震荡信号
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 //ProjeceName:TwoLed 2 //write by:cyt 3 //Time:2017-2-10 4 #include<AT89X51.h> 5 6 void main() 7 { 8 unsigned int a=0; 9 unsigned char b=0; 10 do{ 11 for(a=0;a<50000;a++) 12 P1_0 = 0; 13 P1_0 = 1; 14 for(b=0;b<200;b++) 15 P1_1 = 0; 16 P1_1 = 1; 17 for(a=0;a<30000;a++) 18 ; 19 }while(1); 20 }