电子测量 频率计实验.docVIP

  • 6
  • 0
  • 约1.96千字
  • 约 3页
  • 2018-05-17 发布于河南
  • 举报
电子测量 频率计实验

实验名称:频率与周期的数字测量 实验目的:掌握频率与周期的测量数字方法 了解频率计的基本结构与设计方法 用51单片机设计的简易频率电路图 实验主程序: #include reg51.h #include LCD1602.h sbit CLR = P3^0; sbit FGT = P3^1; sbit f = P3^2; unsigned char TempBuffer[12]; void IntToStr(unsigned int t, unsigned char *str, unsigned char n) { unsigned char a[5]; char i, j; a[0]=(t/10000)%10; //取得整数值到数组 a[1]=(t/1000)%10; a[2]=(t/100)%10; a[3]=(t/10)%10; a[4]=(t/1)%10; for(i=0; i5; i++) //转成ASCII码 a[i]=a[i]+0; for(i=0; a[i]==0 i=3; i++); for(j=5-n; ji; j++) //填充空格 { *str= ; str++; } for(; i5; i++) { *s

文档评论(0)

1亿VIP精品文档

相关文档