lamiastella

Untitled

Oct 26th, 2015
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.44 KB | None | 0 0
  1. private Double getTemperature() {
  2.  String consoleOutput;
  3.  if (simulated!=null&&simulated.equals("simulated")) {
  4.  consoleOutput = getSimulatedConsoleOutput();
  5.  } else {
  6.  consoleOutput = getCommandResults("sudo " + PI_HOME +
  7. PATH_TO_TEMP_HUMID_COMMAND + " 2302 4"); // line with the pin number to which the
  8. data wire of the sensor is connected on the RPI
  9.  }
  10.  Double temperature = parseTemperatureFromString(consoleOutput);
  11.  return temperature;
  12.  }
Advertisement
Add Comment
Please, Sign In to add comment