
其实你需要的不是高温报警,你需要在桌面以及游戏内都是随时看到实时电脑工况的软件,游戏加加可以满足这个要求,不管在桌面还是游戏内都可以显示CPU,GPU,内存,主板,硬盘的温度,频率,占用等情况,不用每次都麻烦的切回桌面看了。
硬件做好了吗
可以把原理图给我
我做单片机的
我们可以给你提供。 //初始化DS18B20
//让DS18B20一段相对长时间低电平, 然后一段相对非常短时间高电平, 即可启动
void dsInit()
{
//对于110592MHz时钟, unsigned int型的i, 作一个i++ *** 作的时间大于8us
unsigned int i;
ds = 0;
i = 100; //拉低约800us, 符合协议要求的480us以上
while(i>0) i--;
ds = 1; //产生一个上升沿, 进入等待应答状态
i = 4;
while(i>0) i--;
}
void dsWait()
{
unsigned int i;
while(ds);
while(~ds); //检测到应答脉冲
i = 4;
while(i > 0) i--;
}
//向DS18B20读取一位数据
//读一位, 让DS18B20一小周期低电平, 然后两小周期高电平,
//之后DS18B20则会输出持续一段时间的一位数据
bit readBit()
{
unsigned int i;
bit b;
ds = 0;
i++; //延时约8us, 符合协议要求至少保持1us
ds = 1;
i++; i++; //延时约16us, 符合协议要求的至少延时15us以上
b = ds;
i = 8;
while(i>0) i--; //延时约64us, 符合读时隙不低于60us要求
return b;
}
//读取一字节数据, 通过调用readBit()来实现
unsigned char readByte()
{
unsigned int i;
unsigned char j, dat;
dat = 0;
for(i=0; i<8; i++)
{
j = readBit();
//最先读出的是最低位数据
dat = (j << 7) | (dat >> 1);
}
return dat;
}
}
//向DS18B20发送温度转换命令
void sendChangeCmd()
{
dsInit(); //初始化DS18B20, 无论什么命令, 首先都要发起初始化
dsWait(); //等待DS18B20应答
delay(1); //延时1ms, 因为DS18B20会拉低DQ 60~240us作为应答信号
writeByte(0xcc); //写入跳过序列号命令字 Skip Rom
writeByte(0x44); //写入温度转换命令字 Convert T
}
//向DS18B20发送读取数据命令
void sendReadCmd()
{
dsInit();
dsWait();
delay(1);
writeByte(0xcc); //写入跳过序列号命令字 Skip Rom
writeByte(0xbe); //写入读取数据令字 Read Scratchpad
}
//获取当前温度值
int getTmpValue()
{
int value; //存放温度数值
float t;
unsigned char low, high;
sendReadCmd();
//连续读取两个字节数据
low = readByte();
high = readByte();
tmpvalue = high;
tmpvalue <<= 8;
tmpvalue |= low;
value = tmpvalue;
//使用DS18B20的默认分辨率12位, 精确度为00625度, 即读回数据的最低位代表00625度
t = value 00625;
value = t 100 + (value > 0 05 : -05); //大于0加05, 小于0减05
return value;
}
unsigned char const timeCount = 3; //动态扫描的时间间隔
//显示当前温度值, 精确到小数点后一位
//若先位选再段选, 由于IO口默认输出高电平, 所以当先位选会使数码管出现乱码
/void display()
{
unsigned int tmp = abs(tempValue);
switch(sum)
{
case 1: PA8255=table[tmp % 10]; PB8255=0xfe; delay(1);
PA8255=table[ tmp % 100 / 10]; PB8255=0xfd; delay(1);
PA8255=tableWidthDot[ tmp % 1000 / 100]; PB8255=0xfb; delay(1);
PA8255=table[tmp % 10000 / 1000]; PB8255=0xf7; delay(1); PB8255=0xff;break; //显示温度
case 2: PA8255=table[0]; PB8255=0xfe; delay(1);
PA8255=tableWidthDot[high%10]; PB8255=0xfd; delay(1);
PA8255=table[high/10]; PB8255=0xfb; delay(1); PB8255=0xff; break; //显示上限温度
case 3: PA8255=table[0]; PB8255=0xfe; delay(1);
PA8255=tableWidthDot[low%10]; PB8255=0xfd; delay(1);
PA8255=table[low/10]; PB8255=0xfb; delay(1); PB8255=0xff; break; //显示下限温度
default: break;
}
} /
Into() interrupt 0
{ sum++;
if(sum==4)
sum=1;
}
uchar keyscan() //键盘扫描,调整温度上下限
{
PC8255=0xfc;
if((PC8255&0xc0)!=0xc0)
{
delay(40);
if((PC8255&0xc0)!=0xc0)
PC8255=0xfe;
if((PC8255&0xc0)==0x80)
high++;
if((PC8255&0xc0)==0x40)
high--;
PC8255=0xfd;
if((PC8255&0xc0)==0x80)
low++;
if((PC8255&0xc0)==0x40)
low--;
}
}
void main()
{
unsigned int tmp ;
COM8255=0x88;
IT0=1; //外部中断0,采用外部中断0进行实时温度,上限温度和下限温度之间的显示切换
EX0=1;
EA=1;
P1_0=0x1;
sum=1;
high=22; //初始温度上下限设定
low=10;
while(1)
{
//启动温度转换
sendChangeCmd();
tempValue = getTmpValue();
keyscan();// 读取键值
tmp = abs(tempValue); //读取温度
switch(sum)
{
case 1: PA8255=table[tmp % 10]; PB8255=0xfe; delay(1);
PA8255=table[ tmp % 100 / 10]; PB8255=0xfd; delay(1);
PA8255=tableWidthDot[ tmp % 1000 / 100]; PB8255=0xfb; delay(1);
PA8255=table[tmp % 10000 / 1000]; PB8255=0xf7; delay(1); PB8255=0xff;break; //显示温度
case 2: PA8255=table[0]; PB8255=0xfe; delay(1);
PA8255=tableWidthDot[high%10]; PB8255=0xfd; delay(1);
PA8255=table[high/10]; PB8255=0xfb; delay(1); PB8255=0xff; break; //显示上限温度
case 3: PA8255=table[0]; PB8255=0xfe; delay(1);
PA8255=tableWidthDot[low%10]; PB8255=0xfd; delay(1);
PA8255=table[low/10]; PB8255=0xfb; delay(1); PB8255=0xff; break; //显示下限温度
default: break;
}
if(tmp>(high100)|tmp<(low100) ) //&&tempValue>low) //超过温度设定范围,系统自动报警
{
P1_0=0;
}
else
P1_0=1; }
}
#include <intrinsh>
#define uchar unsigned char
#define uint unsigned int
#define out P0 ;
#define INT8U unsigned char //宏定义
#define INT16U unsigned int
sbit smg1=P2^0;
sbit smg2=P2^1;
sbit smg3=P2^2;
sbit smg4=P2^3;
sbit Beep=P1^5; //蜂鸣器引脚定义
sbit led=P1^6;
sbit led1=P1^7; //设置灯光报警键
sbit DQ=P2^4; //ds18b20端口
void init_ds18b20(void); //ds18b20初始化子程序
void delay(uchar); //ds18b20工作延时子程序
uchar readbyte(void);//向ds18b20读一个字节数据
//
void writebyte(uchar);//向ds18b20写一个字节数据
uint retemp();//计数变量
uchar key;
uchar a,b,c,d; //计数变量
uchar x[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};
uint retemp()
{
uint a,b,t;
init_ds18b20(); //初始化ds18b20
writebyte(0xcc); // 跳过读序列号的 *** 作
writebyte(0x44); // 启动温度转换
init_ds18b20();
writebyte(0xcc); //跳过读序号列号的 *** 作
writebyte(0xbe); //读取温度寄存器等(共可读9个寄存器) 前两个就是温度
a=readbyte(); //读出温度低位LSB
b=readbyte(); //读出温度高位MSB
t=b; //将温度高八位送t
t<<=8; //乘以256移到高八位
t=t|a; //高低八位组合成温度值
if(t<0x8000) //如果温度为正计算正温度值
{
key=0;
t=t0625;
}
else //否则温度为负,取反
{
key=1;
t=(~t+1)0625;
}
return(t); //返回温度值
}
void main()
{
uint i,t;
EA = 1; //开总中断
TMOD = 0x01; //定时器0工作方式1
TR0=1;
delay(100);
while(1)
{
t=retemp(); 读温度值
a=x[t/1000]; //温度千位数
b=x[t/100%10]; //温度百位数
c=x[t/10%10]-0x80; //温度十位数
d=x[t%10]; //温度个位数
if(key==1) //如果key=1
a=0xbf; //a为“负号"
if((key==0)&&(t>320)) //如果key=0 且t大于320
{
led1=0; //点亮led1
ET0=1; //开启定时器0中断
}
else if(t<290) //如果温度小于290
{
led=0; //点亮led
ET0=1; //开启定时器0中断
}
else //否则
{
led1=1; //关闭led1
led=1; //关闭led
ET0=0; //关闭定时器0中断
}
for(i=0;i<50;i++) //循环50次
{smg1=1;P0=a;delay(100);smg1=0; //显示千位
smg2=1;P0=b;delay(100);smg2=0; //显示百位
smg3=1;P0=c;delay(100);smg3=0; //显示十位
smg4=1;P0=d;delay(100);smg4=0; //显示个位
}
}
}
/ds18b20工作延时子程序/
void delay (uchar i)
{
do
{_nop_();
_nop_();
_nop_();
i--;
}
while(i);}
/ds18b20初始化子程序/
void init_ds18b20()
{
uchar x=0;
DQ=0; //单片机将DQ拉低
delay (120);
DQ=1; //拉高总线
delay(16);
delay(80);
}
/读一个字节/
uchar readbyte ()
{uchar i=0,date=0;
for(i=8;i>0;i--)
{
DQ=0; // 给脉冲信号
delay(1);
DQ=1; // 给脉冲信号
date>>=1;
if(DQ)date|=0x80;
delay(11);
}
return(date);
}
/写一个字节/
void writebyte(uchar dat)
{uchar i=0;
for(i=8;i>0;i--) //写8位数
{
DQ=0;
DQ=dat&0x01; //写dat的D0位
delay(12);
DQ=1;
dat>>=1;
delay(5);
}
}
/
函数名:中断函数
描 述:产生矩形脉冲使蜂鸣器发声
/
void BeepTimer0(void) interrupt 1
{
Beep = ~Beep;
TH0 = 65335 / 256; //定时器赋初值
TL0 = 65335 % 256;
}
以上就是关于求电脑硬件温度监控软件 要能够高温报警的(就是设置一个温度值,超过了它会警告),AIDA64全部的内容,包括:求电脑硬件温度监控软件 要能够高温报警的(就是设置一个温度值,超过了它会警告),AIDA64、我想用单片机AT89S51实现温度报警,预设温度是105℃,超出这个温度则LED灯亮,蜂鸣器响.设计一个程序、STC89C52单片机,用C语言编温度报警器的程序等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)