?? therm.c
字號:
#include <string.h>
#include <stdlib.h>
ioport unsigned int portbfff;
extern void dspinit();
extern void bsp2init();
extern void writetherm(unsigned int);
extern unsigned int readtherm();
extern void resettherm();
/////////////////////////////////////////////////////////////
void smg_dis(unsigned int address,unsigned int dot,unsigned int value, unsigned int light)
{
unsigned int temp;
temp=((address<<6)&0xc0)+(dot?0x10:0x00)+(light?0x20:0x00)+value;
portbfff=temp;
}
void dis_therm(unsigned int value)
{
unsigned int temp;
temp=value&0x0f;
temp=temp*10/16;
smg_dis(0,0,temp,1);
value=value>>4;
temp=value%10;
value=value/10;
smg_dis(1,1,temp,1);
temp=value%10;
smg_dis(2,0,temp,1);
temp=value/10;
smg_dis(3,0,temp,1);
}
void main()
{
unsigned int i;
dspinit();
bsp2init();
while(1)
{
resettherm();
writetherm(0xcc);
writetherm(0x44);
i=readtherm();
while(i!=0xfff)
{
i=readtherm();
}
for(i=0;i<0xfff;i++);
resettherm();
writetherm(0xcc);
writetherm(0xbe);
i=readtherm();
dis_therm(i);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -