#include<reg51.h>
unsigned char a[16]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,
0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71},b[4],c=0x01;
sbit START=P2^4;
sbit OE=P2^6;
sbit EOC=P2^5;
sbit add_a=P2^2;
sbit add_b=P2^1;
sbit add_c=P2^0;
sbit led=P2^7;
sbit buzzer=P2^3;
void Delaylms(unsigned int count)
{
unsigned int i,j;
for(i=0;i<count;i++)
for(j=0;j<120;j++);
}
void show( )
{
unsigned int r;
for(r=0;r<4;r++)
{
P1=(c<<r);
P3=b[r];
if(r= =5)
P3=P3 | 0x80;
Delay1
DAC0832电源电路
最新推荐文章于 2024-12-03 10:44:09 发布