基于单片机数字电压表仿真设计-毕设课设资料
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)