{"action":"created","issue":{"url":"https://api.github.com/repos/finitespace/BME280/issues/27","repository_url":"https://api.github.com/repos/finitespace/BME280","labels_url":"https://api.github.com/repos/finitespace/BME280/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/finitespace/BME280/issues/27/comments","events_url":"https://api.github.com/repos/finitespace/BME280/issues/27/events","html_url":"https://github.com/finitespace/BME280/issues/27","id":252844442,"number":27,"title":"consider changing Initialize() to public for bme280 forced mode","user":{"login":"pabloandresm","id":10205701,"avatar_url":"https://avatars0.githubusercontent.com/u/10205701?v=4","gravatar_id":"","url":"https://api.github.com/users/pabloandresm","html_url":"https://github.com/pabloandresm","followers_url":"https://api.github.com/users/pabloandresm/followers","following_url":"https://api.github.com/users/pabloandresm/following{/other_user}","gists_url":"https://api.github.com/users/pabloandresm/gists{/gist_id}","starred_url":"https://api.github.com/users/pabloandresm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pabloandresm/subscriptions","organizations_url":"https://api.github.com/users/pabloandresm/orgs","repos_url":"https://api.github.com/users/pabloandresm/repos","events_url":"https://api.github.com/users/pabloandresm/events{/privacy}","received_events_url":"https://api.github.com/users/pabloandresm/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-08-25T09:23:21Z","updated_at":"2017-10-09T19:10:43Z","closed_at":"2017-09-20T04:06:44Z","author_association":"NONE","body":"The forced mode of the bme280 allows a one shot read of the bme280 values (temp, humidity, etc).\r\n\r\nThe forced mode is selected in the constructor. The constructor calls Initialize() and sets forced mode (if the user set it to 1).\r\n\r\nIf that is the case, then the first read will give the values and put the bme280 in sleep mode (that is the way forced mode works).\r\n\r\nThe problem is that forced mode needs to be setted again to be able to be used again. It is resetted every read. The only way to do this is to call \"WriteRegister(CONFIG_ADDR, config);\" again.\r\n\r\nToday it is called only at the constructor, which calls Initialize();\r\n\r\nThat is why I suggest to move in both I2C and Spi .h header files the Initialize() to \"public:\", so after a call to read we can call Initialize() again to set again forced mode and continue with another read and so forth.\r\n\r\nThat is the easy way. It works. I tested it.\r\n\r\nAnother more complicated way would be to handle it internally, with a flag somewhere, for every read, if the bme280 constructor setted forced mode, set it again before each read."},"comment":{"url":"https://api.github.com/repos/finitespace/BME280/issues/comments/335258368","html_url":"https://github.com/finitespace/BME280/issues/27#issuecomment-335258368","issue_url":"https://api.github.com/repos/finitespace/BME280/issues/27","id":335258368,"user":{"login":"finitespace","id":9065954,"avatar_url":"https://avatars0.githubusercontent.com/u/9065954?v=4","gravatar_id":"","url":"https://api.github.com/users/finitespace","html_url":"https://github.com/finitespace","followers_url":"https://api.github.com/users/finitespace/followers","following_url":"https://api.github.com/users/finitespace/following{/other_user}","gists_url":"https://api.github.com/users/finitespace/gists{/gist_id}","starred_url":"https://api.github.com/users/finitespace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/finitespace/subscriptions","organizations_url":"https://api.github.com/users/finitespace/orgs","repos_url":"https://api.github.com/users/finitespace/repos","events_url":"https://api.github.com/users/finitespace/events{/privacy}","received_events_url":"https://api.github.com/users/finitespace/received_events","type":"User","site_admin":false},"created_at":"2017-10-09T19:10:43Z","updated_at":"2017-10-09T19:10:43Z","author_association":"OWNER","body":"Pablo, \r\n\r\nI did a massive refactor of the code this weekend and I actually found that is not an issue because it is already being done.  The config is pushed to the bme before every read if in forced mode.\r\n\r\nTyler"}}
{"actor":{"display_login":"finitespace"}}