{"action":"created","issue":{"url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/610","labels_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/610/labels{/name}","comments_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/610/comments","events_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/610/events","html_url":"https://github.com/nodemcu/nodemcu-firmware/issues/610","id":102428826,"number":610,"title":"ds18b20.lua | Handling difference between DS18S20 and DS18B20","user":{"login":"windows97","id":3279299,"avatar_url":"https://avatars.githubusercontent.com/u/3279299?v=3","gravatar_id":"","url":"https://api.github.com/users/windows97","html_url":"https://github.com/windows97","followers_url":"https://api.github.com/users/windows97/followers","following_url":"https://api.github.com/users/windows97/following{/other_user}","gists_url":"https://api.github.com/users/windows97/gists{/gist_id}","starred_url":"https://api.github.com/users/windows97/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/windows97/subscriptions","organizations_url":"https://api.github.com/users/windows97/orgs","repos_url":"https://api.github.com/users/windows97/repos","events_url":"https://api.github.com/users/windows97/events{/privacy}","received_events_url":"https://api.github.com/users/windows97/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-21T17:39:18Z","updated_at":"2015-10-05T02:35:22Z","closed_at":null,"body":"Looks like DS18B20 only works proper with ds18b20 (having FAMILY CODE == 0x28).\r\nDS18**B**20  (FAMILY CODE == 0x28) has a 12bit resolution w/ 2^(-4) lsb = 0,0625 which is correclty applied.\r\n![2015-08-21 19_35_04-](https://cloud.githubusercontent.com/assets/3279299/9414846/c6345702-483b-11e5-9018-35e85d5364cb.png)\r\n*derived from http://datasheets.maximintegrated.com/en/ds/DS18B20.pdf*\r\n\r\nDS18**S**20 (FAMILY CODE == 0x10) has a 9bit resolution w/ 2^(-1) lsb = 0,5 which is not handled correctly.\r\n![2015-08-21 19_34_34-](https://cloud.githubusercontent.com/assets/3279299/9414847/c634cc50-483b-11e5-94d8-6791c721ec8c.png)\r\n*derived from http://datasheets.maximintegrated.com/en/ds/DS18S20.pdf*\r\n\r\nThis factor should be handled according to the FAMILY CODE.\r\n"},"comment":{"url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/comments/145413482","html_url":"https://github.com/nodemcu/nodemcu-firmware/issues/610#issuecomment-145413482","issue_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/610","id":145413482,"user":{"login":"nickandrew","id":7175,"avatar_url":"https://avatars.githubusercontent.com/u/7175?v=3","gravatar_id":"","url":"https://api.github.com/users/nickandrew","html_url":"https://github.com/nickandrew","followers_url":"https://api.github.com/users/nickandrew/followers","following_url":"https://api.github.com/users/nickandrew/following{/other_user}","gists_url":"https://api.github.com/users/nickandrew/gists{/gist_id}","starred_url":"https://api.github.com/users/nickandrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickandrew/subscriptions","organizations_url":"https://api.github.com/users/nickandrew/orgs","repos_url":"https://api.github.com/users/nickandrew/repos","events_url":"https://api.github.com/users/nickandrew/events{/privacy}","received_events_url":"https://api.github.com/users/nickandrew/received_events","type":"User","site_admin":false},"created_at":"2015-10-05T02:35:22Z","updated_at":"2015-10-05T02:35:22Z","body":"I fixed the code in `lua_examples/onewire-ds18b20.lua` ... oh hang on, there's more code under `lua_modules` ..."}}