STC12C5A60S2单片机AD转换程序.pdfVIP

  • 55
  • 0
  • 约1.62千字
  • 约 2页
  • 2020-11-10 发布于天津
  • 举报
STC12C5A60S2 单片机 AD 转换程序 转换结果显示在数码管上,数码管电路图如下 #includeSTC12C5A.h #includemath.h unsigned char code dofly[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f}; unsigned int num,result; void delay(unsigned int cnt) { unsigned char i; for(;cnt0;cnt--) for(i=0;i250;i++); } void display(unsigned int num) { unsigned char n[5],i; n[0]=num%100000/10000; n[1]=num%10000/1000; n[2]=num%1000/100; n[3]=num%100/10; n[4]=num%10; for(i=0;i5;i++) { P0=dofly[n[i]]; P2=i; delay(1); } P0=0x

文档评论(0)

1亿VIP精品文档

相关文档