其他分享
首页 > 其他分享> > 1267【毕设课设】基于单片机ACS712直流电流测量检测设计

1267【毕设课设】基于单片机ACS712直流电流测量检测设计

作者:互联网

【资源下载】百度网盘下载地址如下:

https://docs.qq.com/doc/DTlRSd01BZXNpRUxl

 

 

 

 

#include<reg51.h>
#include<intrins.h>
#define uchar unsigned char
#define uint unsigned int
uchar code Disp_dot[]={0xbf,0x86,0xdb,0xcf,0xe6,0xed,0xfd,0x87,0xff,0xef};			//带小数点的共阴极显示代码
uchar code Dispcode[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x40,0x00};//共阴极显示代码
uchar Display_Buffer[]={0,0,0,0};
bit Flag = 0;
sbit CLK = P3^0;
sbit ST = P3^1;
sbit EOC = P3^2;
sbit OE = P3^3;
void DelayMS(uint t)
{
  uchar i;
  while(t--)
    for(i=110;i>0;i--);
}
uchar ADRead()
{
  uchar val = 0;
  ST=0;ST=1;ST=0;		//启动A/D转换
  while(!EOC);		    //等待转换完成
  OE=1;
  val=P1;				//读转换值
  OE=0;
  return(val);

 

 

  

 

标签:P3,毕设,ACS712,课设,uchar,OE,ST,val,sbit
来源: https://www.cnblogs.com/ythero/p/14501090.html