{"action":"closed","issue":{"url":"https://api.github.com/repos/milesburton/Arduino-Temperature-Control-Library/issues/21","labels_url":"https://api.github.com/repos/milesburton/Arduino-Temperature-Control-Library/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/milesburton/Arduino-Temperature-Control-Library/issues/21/comments","events_url":"https://api.github.com/repos/milesburton/Arduino-Temperature-Control-Library/issues/21/events","html_url":"https://github.com/milesburton/Arduino-Temperature-Control-Library/issues/21","id":35680507,"number":21,"title":"new demo sketch to be added","user":{"login":"RobTillaart","id":462844,"avatar_url":"https://avatars.githubusercontent.com/u/462844?v=3","gravatar_id":"","url":"https://api.github.com/users/RobTillaart","html_url":"https://github.com/RobTillaart","followers_url":"https://api.github.com/users/RobTillaart/followers","following_url":"https://api.github.com/users/RobTillaart/following{/other_user}","gists_url":"https://api.github.com/users/RobTillaart/gists{/gist_id}","starred_url":"https://api.github.com/users/RobTillaart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RobTillaart/subscriptions","organizations_url":"https://api.github.com/users/RobTillaart/orgs","repos_url":"https://api.github.com/users/RobTillaart/repos","events_url":"https://api.github.com/users/RobTillaart/events{/privacy}","received_events_url":"https://api.github.com/users/RobTillaart/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2014-06-13T15:18:48Z","updated_at":"2015-09-23T06:30:48Z","closed_at":"2015-09-23T06:30:48Z","body":"shows how to use the library with two sensors on different pins.\r\nuseful for explicit pin to sensor relation\r\n\r\nSee this thread - http://forum.arduino.cc/index.php?topic=216835.msg1764333#msg1764333  - \r\n\r\n//\r\n//    FILE: TwoPin_DS18B20.ino\r\n//  AUTHOR: Rob Tillaart\r\n// VERSION: 0.1.00\r\n// PURPOSE: two pins for two sensors demo\r\n//    DATE: 2014-06-13\r\n//     URL:\r\n//\r\n// Released to the public domain\r\n//\r\n\r\n#include <OneWire.h>\r\n#include <DallasTemperature.h>\r\n\r\n#define ONE_WIRE_BUS_1   2\r\n#define ONE_WIRE_BUS_2   4\r\n\r\nOneWire oneWire_in(ONE_WIRE_BUS_1);\r\nOneWire oneWire_out(ONE_WIRE_BUS_2);\r\n\r\nDallasTemperature sensor_inhouse(&oneWire_in);\r\nDallasTemperature sensor_outhouse(&oneWire_out);\r\n\r\nvoid setup(void)\r\n{\r\n  Serial.begin(9600);\r\n  Serial.println(\"Dallas Temperature IC Control Library Demo - TwoPin_DS18B20\");\r\n\r\n  sensor_inhouse.begin();\r\n  sensor_outhouse.begin();\r\n}\r\n\r\nvoid loop(void)\r\n{ \r\n  Serial.print(\"Requesting temperatures...\");\r\n  sensor_inhouse.requestTemperatures(); \r\n  sensor_outhouse.requestTemperatures(); \r\n  Serial.println(\"DONE\");\r\n  \r\n  Serial.print(\"Inhouse: \");\r\n  Serial.println(sensor_inhouse.getTempCByIndex(0));  \r\n  Serial.print(\"Outhouse: \");\r\n  Serial.println(sensor_outhouse.getTempCByIndex(0));  \r\n}"}}