欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136
標題:
為什么Keil只有1個提醒,硬件無法顯示?求助
[打印本頁]
作者:
叮當szh
時間:
2019-3-23 20:19
標題:
為什么Keil只有1個提醒,硬件無法顯示?求助
#include <reg52.h>
#include <intrins.h>
typedef unsigned char INT8U;
typedef unsigned char uchar;
typedef unsigned int INT16U;
typedef unsigned int uint;
sbit DS = P3^6;
//sbit DU = P1;
//sbit WE = P2;
uchar code table[]={
//0 1 2 3 4 5 6 7 8
0xC0, 0xF9, 0xA4, 0xB0, 0x99, 0x92, 0x82, 0xF8, 0x80,
//9 A B C D E F - . 關顯示
0x90, 0x88, 0x83, 0xC6, 0xA1, 0x86, 0x8E, 0xBF, 0x7F, 0xFF};
uchar code T_COM[] = {0xfe, 0xfd, 0xfb, 0xf7,};//數碼管位碼
/*us延時函數,執行一次US--所需6.5us進入一次函數需要11.95us*/
void Delay_us(uchar us)
{
while(us--);
}
/*====================================
函數 : delay(uint z)
參數 :z 延時毫秒設定,取值范圍0-65535
返回值 :無
描述 :12T/Fosc11.0592M毫秒級延時
====================================*/
void delay(uint z)
{
uint x,y;
for(x = z; x > 0; x--)
for(y = 114; y > 0 ; y--);
}
void Display(INT16U Value)
{
P1 = 0XFF;
P2 = T_COM[1];
P1 = table[Value/100];
delay(5);
P1 = 0XFF;
P1 = 0XFF;
P2 = T_COM[2];
P1 = table[Value%100/10]&0x7f;
delay(5);
P1 = 0XFF;
P1 = 0XFF;
P2 = T_COM[3];
P1 = table[Value%10];
delay(5);
P1 = 0XFF;
}
bit ds_init()
{
bit i;
DS = 1;
_nop_();
DS = 0;
Delay_us(75);
DS = 1;
Delay_us(4);
i = DS;
Delay_us(20);
DS = 1;
_nop_();
return(i);
}
void write_byte(uchar dat)
{
uchar i;
for(i=0;i<8;i++)
{
DS = 0;
_nop_();
DS = 1;
DS = dat & 0x01;
Delay_us(10);
DS = 1; //釋放總線準備下一次數據寫入
_nop_();
dat >>= 1;
}
}
uchar read_byte()
{
uchar i, j, dat;
for(i=0;i<8;i++)
{
DS = 0;
_nop_();
DS = 1;
_nop_();
j = DS;
Delay_us(10);
DS = 1;
_nop_();
dat = (j<<7)|(dat>>1);
}
return (dat);
}
void main()
{
uint i=0;
uchar L, M;
/* ds_init();
write_byte(0xcc);
write_byte(0x4e);
write_byte(0x7f);
write_byte(0xf7);
write_byte(0x1f);
ds_init();
write_byte(0xcc);
write_byte(0x48);*/
while(1)
{
ds_init();
write_byte(0xcc);
write_byte(0x44);
ds_init();//初始化DS18B20
write_byte(0xcc);
write_byte(0xbe);
L = read_byte();
M = read_byte();
i = M;
i <<=8;
i |= L;
i = i * 0.0625 * 10 + 0.5;
}
{
Display(i); delay(10);
}
}
linking...
*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
SEGMENT: ?PR?_DISPLAY?WHENG
Program Size: data=11.1 xdata=0 code=1193
creating hex file from "1"...
"1" - 0 Error(s), 1 Warning(s).
作者:
admin
時間:
2019-3-24 02:10
您這個問題給的信息不全,估計是沒人能回答得了的,先轉移到冷門區了,自行點擊編輯按鈕補充一下吧,審核員會幫你重新轉到熱門問答區的
歡迎光臨 (http://www.raoushi.com/bbs/)
Powered by Discuz! X3.1