Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private Double getTemperature() {
- String consoleOutput;
- if (simulated!=null&&simulated.equals("simulated")) {
- consoleOutput = getSimulatedConsoleOutput();
- } else {
- consoleOutput = getCommandResults("sudo " + PI_HOME +
- PATH_TO_TEMP_HUMID_COMMAND + " 2302 4"); // line with the pin number to which the
- data wire of the sensor is connected on the RPI
- }
- Double temperature = parseTemperatureFromString(consoleOutput);
- return temperature;
- }
Advertisement
Add Comment
Please, Sign In to add comment