日本黄色一级经典视频|伊人久久精品视频|亚洲黄色色周成人视频九九九|av免费网址黄色小短片|黄色Av无码亚洲成年人|亚洲1区2区3区无码|真人黄片免费观看|无码一级小说欧美日免费三级|日韩中文字幕91在线看|精品久久久无码中文字幕边打电话

當前位置:首頁 > 技術學院 > 熱搜器件
[導讀]#include< reg52.h>#define uint unsigned int#define uchar unsigned charuchar aa,qian,bai,shi,ge;uint temp;sbit clock=P2^0;sbit start=P2^1;sbit eoc=P2^2;sbit oe=P2^3;sbit ale=P2^4;sbit adda=P2^5;uchar c

#include< reg52.h>

#define uint unsigned int

#define uchar unsigned char

uchar aa,qian,bai,shi,ge;

uint temp;

sbit clock=P2^0;

sbit start=P2^1;

sbit eoc=P2^2;

sbit oe=P2^3;

sbit ale=P2^4;

sbit adda=P2^5;

uchar code table[]={

0x3f,0x06,0x5b,0x4f,

0x66,0x6d,0x7d,0x07,

0x7f,0x6f,0x77,0x7c,

0x39,0x5e,0x79,0x71

};

//void display(uchar bai,uchar shi,uchar ge);

void delay(uint z);

void main()

{

TMOD=0x20; //設置定時器1為工作方式2

TH1=0x216; //216

TL1=0x216; //216

EA=1; //開總中斷

ET1=1; //開t1中斷

TR1=1;

start=0; //復位

oe=0; //輸出

adda=0;

//eoc=0;

ale=0; //關閉地址選擇

while(1)

{

start=0;

///delay(10);

start=1; // 復位

ale=1; // 打開地址選擇

adda=0;

///delay(10);

start=0; // 開始轉換

ale=0; // 關地址

//delay(1);

while(eoc==0); // 等待eoc變?yōu)?

//delay(1);

oe=1; // 打開輸出

//delay(1);

//P1=0xff;

temp=P1; // 取p1到p3

oe=0; // 關輸出

temp=temp*50;

temp=temp/256;

qian=temp/1000;

bai=temp%1000/100;

shi=temp%100/10;

ge=temp%10;

P3=0x00;

P0=0xfe;

P3=table[qian];

delay(50);

P3=0x00;

P0=0xfd;

P3=table[bai];

delay(50);

P3=0x00;

P0=0xfb;

P3=table[shi];

delay(50);

P3=0x00;

P0=0xf7;

P3=table[ge];

}

}

void delay(uint z)

{

uint x,y;

for(x=z;x>0;x--)

for(y=1;y>0;y--);

}

void cl() interrupt 3

{

clock=!clock;

}

本站聲明: 本文章由作者或相關機構授權發(fā)布,目的在于傳遞更多信息,并不代表本站贊同其觀點,本站亦不保證或承諾內容真實性等。需要轉載請聯(lián)系該專欄作者,如若文章內容侵犯您的權益,請及時聯(lián)系本站刪除( 郵箱:macysun@21ic.com )。
換一批
延伸閱讀
關閉