欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136
標(biāo)題:
單片機(jī)進(jìn)行數(shù)學(xué)運(yùn)算與顯示實(shí)驗(yàn)
[打印本頁(yè)]
作者:
liuda
時(shí)間:
2015-1-21 22:46
標(biāo)題:
單片機(jī)進(jìn)行數(shù)學(xué)運(yùn)算與顯示實(shí)驗(yàn)
是用51hei單片機(jī)開(kāi)發(fā)板 電路圖詳見(jiàn):
http://www.raoushi.com/f/51hei-5.pdf
的數(shù)碼管部分, 用2個(gè)74hc573 鎖存,p0口作為數(shù)據(jù)口 ,p3.6和p3.7分別是段和位的鎖存端口.
#include<reg52.h>
#define uchar unsigned char
#define uint unsigned int
uchar code SEG7[10]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
sbit D=P3^6;
sbit V=P3^7;
void delay(uint k);
//=================
void main(void)
{
uchar a,b,c,out;
a=100;
b=60;
c=9;
out=a+3*(b-c)/2;
while(1)
{
D=1;
P0=SEG7[out/100];
D=0;
P0=0xff;
V=1;
P0=0xfe;
V=0;
delay(1);
D=1;
P0=SEG7[(out%100)/10];
D=0;
P0=0xff;
V=1;
P0=0xfd;
V=0;
delay(1);
D=1;
P0=SEG7[out%10];
D=0;
P0=0xff;
V=1;
P0=0xfb;
V=0;
delay(1);
}
}
//=====================
void delay(uint k)
{
uint i,j;
for(i=0;i<k;i++){
for(j=0;j<121;j++)
{;}}
}
復(fù)制代碼
歡迎光臨 (http://www.raoushi.com/bbs/)
Powered by Discuz! X3.1