Advertisement
Guest User

tempcalc

a guest
Jan 16th, 2013
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.49 KB | None | 0 0
  1.  public double tempcalc(double voltage)
  2.         {
  3.             double temp;
  4.             double cprv = 0.033;
  5.             double zero = 1.65;
  6.             int x = 50;
  7.            
  8.             if (voltage == 0)
  9.             {
  10.                 temp = x * (-1);
  11.             }
  12.             else if(voltage == zero)
  13.             {
  14.                 temp = 0;
  15.             }
  16.             else
  17.             {
  18.                 temp = (voltage / cprv) - x;
  19.             }
  20.             return temp;
  21.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement