下载资源后端资源详情
Rtd_Driver.zip
大小:2.31KB
价格:28积分
下载量:0
评分:
5.0
上传者:qq_41124801
更新日期:2024-08-28

软件篇PT100、NTC等温度传感器阻值-温度换算模块

资源文件列表(大概)

文件名
大小
Rtd_Driver/Rtd_Driver.c
2.13KB
Rtd_Driver/Rtd_Driver.h
2.31KB
Rtd_Driver/TypeDef.h
1.79KB
Rtd_Driver/
-

资源内容介绍

软件篇PT100、NTC等温度传感器阻值-温度换算模块
/********************************************************************************** 文 件 名:Rtd_Driver.c**------文件信息-----------------------------------------* 程序功能: 温度传感器采集模块**------版本历史-----------------------------------------* 创 建 人: 剑胆琴心* 创建时间: 2024.08.28* 版 本: V1.00* 修 改 人:* 修改时间: * 修改说明:*********************************************************************************/#define Rtd_Driver_GLOBALS/********************************************************************************** 包含文件*********************************************************************************/#include "Include_All.h"float Res2Temp(float RES){ int end = RES_MAX - 1; int front = 0; int half = 0; float temp; if((RES <= RTD_RES_TAB[0]) && (RES >= RTD_RES_TAB[RES_MAX - 1])) { for(half = RES_MAX / 2; end - front !=1;) { if (RES > RTD_RES_TAB[half]) { end = half; half = (end + front) / 2; } else if (RES < RTD_RES_TAB[half]) { front = half; half = (front + end) / 2; } else { front = half; end = half; break; } } if(front == end) { temp = front; } else { temp = (RTD_RES_TAB[front] - RES) / (RTD_RES_TAB[front] - RTD_RES_TAB[end]) * RTD_TEMP_STEP + front; } } else { temp =-100; } return temp;}/********************************************************************************** 文件结束*********************************************************************************/

用户评论 (0)

发表评论

captcha