convert.java

来自「主要用于无线传感网络的编写的书籍.对于初学者有着很大的用处」· Java 代码 · 共 26 行

JAVA
26
字号
// Written by Kin Sun Ho. October 2005// This program is used to convert raw temperature samples into the unit of// degrees   public class convert{        public static void main(String args[])  {        int input = (new Integer(args[0])).intValue();	System.out.println(todegree(input));	return;    }    public static double todegree(int raw) {        double a       = 0.00130705;        double b       = 0.000214381;        double c       = 0.000000093;        double k       = 273.15;        double adc_fs  = 1023;        double r1      = 10*1000;        double r       = r1*(adc_fs-raw)/raw;        double rkelvin = a + b*Math.log(r) + c*(Math.log(r))*(Math.log(r))*(Math.log(r));        double kelvin  = 1/rkelvin;        return kelvin-k;    }}

⌨️ 快捷键说明

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