{"action":"created","issue":{"url":"https://api.github.com/repos/mysensors/MySensors/issues/575","repository_url":"https://api.github.com/repos/mysensors/MySensors","labels_url":"https://api.github.com/repos/mysensors/MySensors/issues/575/labels{/name}","comments_url":"https://api.github.com/repos/mysensors/MySensors/issues/575/comments","events_url":"https://api.github.com/repos/mysensors/MySensors/issues/575/events","html_url":"https://github.com/mysensors/MySensors/issues/575","id":173674736,"number":575,"title":"analogRead() on ESP8266 is not working","user":{"login":"marceloaqno","id":5748824,"avatar_url":"https://avatars.githubusercontent.com/u/5748824?v=3","gravatar_id":"","url":"https://api.github.com/users/marceloaqno","html_url":"https://github.com/marceloaqno","followers_url":"https://api.github.com/users/marceloaqno/followers","following_url":"https://api.github.com/users/marceloaqno/following{/other_user}","gists_url":"https://api.github.com/users/marceloaqno/gists{/gist_id}","starred_url":"https://api.github.com/users/marceloaqno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marceloaqno/subscriptions","organizations_url":"https://api.github.com/users/marceloaqno/orgs","repos_url":"https://api.github.com/users/marceloaqno/repos","events_url":"https://api.github.com/users/marceloaqno/events{/privacy}","received_events_url":"https://api.github.com/users/marceloaqno/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-28T23:42:33Z","updated_at":"2016-12-18T02:49:44Z","closed_at":null,"body":"ESP8266 has a single ADC channel available, it may be used either to read voltage at ADC pin, or to read internal voltage (VCC).\nTo read VCC and make use of hwCPUVoltage() function the following line is required:\nADC_MODE(ADC_VCC);\nhttps://github.com/mysensors/MySensors/blob/development/core/MyHwESP8266.cpp#L117\n\nbut analogRead() won't work anymore (always returns 65535).\n"},"comment":{"url":"https://api.github.com/repos/mysensors/MySensors/issues/comments/267800124","html_url":"https://github.com/mysensors/MySensors/issues/575#issuecomment-267800124","issue_url":"https://api.github.com/repos/mysensors/MySensors/issues/575","id":267800124,"user":{"login":"sushukka","id":19535498,"avatar_url":"https://avatars.githubusercontent.com/u/19535498?v=3","gravatar_id":"","url":"https://api.github.com/users/sushukka","html_url":"https://github.com/sushukka","followers_url":"https://api.github.com/users/sushukka/followers","following_url":"https://api.github.com/users/sushukka/following{/other_user}","gists_url":"https://api.github.com/users/sushukka/gists{/gist_id}","starred_url":"https://api.github.com/users/sushukka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sushukka/subscriptions","organizations_url":"https://api.github.com/users/sushukka/orgs","repos_url":"https://api.github.com/users/sushukka/repos","events_url":"https://api.github.com/users/sushukka/events{/privacy}","received_events_url":"https://api.github.com/users/sushukka/received_events","type":"User","site_admin":false},"created_at":"2016-12-18T02:49:44Z","updated_at":"2016-12-18T02:49:44Z","body":"I just faced this problem when trying to read ACS712 hall sensor on ESP8266 Wemos D1 Mini. Everything worked fine until I included the MySensors library. After that just 65536 values from A0. As the A0 is the only analog input on ESP8266 I'm wondering what is the reason to sacrifice it for VCC reading? \r\n\r\nHowever, hot it working by commenting the ADC_MODE line in MyHwESP8266.CPP. Thanks mfalkvidd for the help. :)\r\n\r\nI also think that using some jumping between modes is not a good idea. It fits badly to the nature of analog reading. Moreover if you really should not have anything connected to A0 when using it as VCC reading, there are not many options but just to leave it alone for analogRead.  "}}
{"actor":{"display_login":"sushukka"}}