基于单片机数字电压表仿真设计-毕设课设资料

1488下载地址 https://docs.qq.com/doc/DWEpnR2pOWU91b3p4?pub=1&dver=2.1.0

#include<reg52.h>
#include<intrins.h>
#define uchar unsigned char
#define uint unsigned int
uchar code table[]={
0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf9,0x80,0x90,
0x40,0x79,0x24,0x30,0x19,0x12,
0xc1};
uchar code aa[]={0x01,0x02,0x04,0x08};
sbit cs1=P1^0;
sbit scl1=P1^1;
sbit sda1=P1^2;
uchar tmpdata[]={0,0,0,0};
uchar readad0831();
void delay(uint g)
{
   uint u;
	for(u=0;u<g;u++);
}
void display()
{
  uchar i;
  for(i=0;i<4;i++)
  {
    P0=aa[i];
		P2=table[tmpdata[i]];
		delay(100);
		P2=0xff;
  }
}
void main()
{
  uint i=0,tmp;
  while(1)

  

 

 

 

posted @ 2021-03-15 20:28  roadroad  阅读(128)  评论(0编辑  收藏  举报
电设屋
上千套电子毕设课设方案