欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136
標(biāo)題:
ADC0809測(cè)量模擬電壓,用數(shù)碼管顯示,數(shù)碼管顯示不正常,四位數(shù)一直閃根本看不清
[打印本頁(yè)]
作者:
HUANGJIEYO
時(shí)間:
2018-3-31 16:54
標(biāo)題:
ADC0809測(cè)量模擬電壓,用數(shù)碼管顯示,數(shù)碼管顯示不正常,四位數(shù)一直閃根本看不清
ADC0809測(cè)量模擬電壓,用數(shù)碼管顯示,數(shù)碼管顯示不正常,四位數(shù)一直閃根本看不清,也不知道是什么原因。請(qǐng)大家?guī)臀铱纯?br />
#include< reg52.h>
#define uchar unsigned char
#define uint unsigned int
uchar code DSY_LED[]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90,0x7f};
uchar code LED_W[]={0xf7,0xfb,0xfd,0xfe,0xff};
sbit ST=P3^2;
sbit ALE=P3^3;
sbit OE=P3^4 ;
sbit EOC=P3^5 ;
void delayms(uint ms)
{uchar i;
while(ms--)for(i=0;i<120;i++);
}
void display(uchar P)
{ uchar ad_data1,ad_data2,ad_data3,ad_data4;
long ad_0809;
ad_0809=P;
OE=0;
P2=0xff;
ad_data1=(ad_0809*4650/255)/1000;
ad_data2=((ad_0809*4650/255)%1000)/100;
ad_data3=(((ad_0809*4650/255)%1000)%100)/10;
ad_data4=((((ad_0809*4650/255)%1000)%100)%10);
P2=LED_W[3];
P1=DSY_LED[ad_data4];
delayms(3);
P2=LED_W[4];
P2=LED_W[2];
P1=DSY_LED[ad_data3];
delayms(3);
P2=LED_W[4];
P2=LED_W[1];
P1=DSY_LED[ad_data2];
delayms(3);
P2=LED_W[4];
P2=LED_W[0];
P1=DSY_LED[ad_data1]&LED_W[10];
delayms(3);
P2=LED_W[4];
}
void main()
{
while(1)
{
ST=0;ST=1;ST=0;
while(EOC==0);
P2=0xff;
OE=1;
display(P0);
OE=0;
}
}
復(fù)制代碼
作者:
yzwzfyz
時(shí)間:
2018-4-1 16:17
硬件圖呢?
歡迎光臨 (http://www.raoushi.com/bbs/)
Powered by Discuz! X3.1