- typedef enum
- {
- PT100=0,//电阻PT100
- CU50=1,//电阻CU50
- BA1=2,//电阻BA1
- BA2=3,//热电偶BA2
- }_InputType;
- typedef struct
- {
- float Confing[6];
- int8_t cishu;
- _InputType type;
- }_Data_Ch;
- float jisuan(_InputType type,float val)
- {
- float d=0;
- uint8_t i,j;
- for(i=0;i<10;i++)
- {
- if(Data_Ch[i].type==type)
- break;
- }
- for(j=0;j<=Data_Ch[i].cishu;j++)
- d+=Data_Ch[i].Confing[j]*pow(val,Data_Ch[i].cishu-j);
- return d;
- }
复制代码 下载:
热电阻曲线拟合.docx
(15.34 KB, 下载次数: 114)
|