vacuumcal.c

来自「我用ARM写的一些东西」· C语言 代码 · 共 58 行

C
58
字号
#include "config.h"
#include "math.h"
 
float   Pressuer;

float GetVaccum(uint16 dat)//数据处理
{
	float Voltage,VTmp,Aa,Bb,Cc;
	/*
		Voltage=(dat>>2)*4.75/100;
		Voltage=0.0778*Voltage*Voltage*Voltage-1.3093*Voltage*Voltage+7.2429*Voltage-7.7656;

		if(Voltage>10)
			Voltage=10;	*/
			
			//Voltage=dat/69.5;//errorset normally = 100
			Voltage=dat/95.0;//errorset normally = 100
			VTmp=Voltage;
			/*if (VTmp>9.57)
			{
				Aa=13.1; Bb=-249.9;  Cc=1199.6;
			}

			else if (VTmp>8.78)
			{
				Aa=0.6421; Bb=-10.8278;  Cc=52.4732;
			}
			
			else if (VTmp>4.45)
			{
				Aa=0.0035 ; Bb= 0.324;  Cc= 3.7104;
			}

			else if (VTmp>2.63)
			{
				Aa=-0.396 ; Bb= 3.5228;  Cc= -2.7571;
			}
			else if (VTmp>2.44)
			{
				Aa=-33.2782 ; Bb=172.5456 ;  Cc=-220.0742 ;
			}
 


			Voltage=Aa*Voltage*Voltage+Bb*Voltage+Cc;
			if (VTmp<2.44)
			{
				Voltage=2;	
			}*/
			if(Voltage>10)
			{
				Voltage=10;
			}
			
		Pressuer=pow(10,(0.778*(Voltage-3.572)))/100.0;
		return Pressuer;
		
	}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?