MAX6675
单片机源程序如下:
- #include <reg52.h>
- #include <intrins.h>
- #include "NTC.h"
- #include "AD.h"
- #include "C595.h"
- #include "Temp.h"
- void NTCmain()
- {
- DianYa(ADmain());
- }
- void DianYa(int DATA5)
- {
- int DAZ,Tem;
- double DAZ1,wendu;
- DAZ=DATA5;
- DAZ1=(double)DAZ;
- if(DAZ>=-155&&DAZ<119)
- {
- wendu=((0.01825*DAZ1)+22.83)*10.0;
- }
- if(DAZ>=119&&DAZ<399)
- {
- wendu=((0.01786*DAZ1)+22.87)*10.0;
- }
- if(DAZ>=399&&DAZ<659)
- {
- wendu=((0.01923*DAZ1)+22.33)*10.0;
- }
- if(DAZ>=659&&DAZ<859)
- {
- wendu=((0.025*DAZ1)+18.53)*10.0;
- }
- if(DAZ>=859&&DAZ<1079)
- {
- wendu=((0.02273*DAZ1)+20.47)*10.0;
- }
- if(DAZ>=1079&&DAZ<1240)
- {
- wendu=((0.03106*DAZ1)+11.49)*10.0;
- }
- if(DAZ>=1240&&DAZ<1414)
- {
- wendu=((0.02874*DAZ1)+14.36)*10.0;
- }
- if(DAZ>=1414&&DAZ<1558)
- {
- wendu=((0.03472*DAZ1)+5.91)*10.0;
- }
- if(DAZ>=1558&&DAZ<1678)
- {
- wendu=((0.04167*DAZ1)-4.92)*10.0;
- }
- if(DAZ>=1678&&DAZ<1768)
- {
- wendu=((0.05556*DAZ1)-22.22)*10.0;
- }
- if(DAZ>=1768&&DAZ<1870)
- {
- wendu=((0.05882*DAZ1)-33.99)*10.0;
- }
- Tem=(int)wendu;
-
- ShowDate(Tem) ;
- Writebyte(0x2a) ;//传递1得断码
- Show();
- }
复制代码
所有资料51hei提供程序下载:
温度板2.rar
(60.25 KB, 下载次数: 23)
|