-->
Page 1 of 1

How to connect DS18B20 on other GPIO?

PostPosted: Fri Aug 19, 2016 3:40 am
by arTii
Hi.
I have my own prototype board http://wiki.abc-service.tk/doku.php?id=esp8266:plytka_a4
where DS18B20 is connected to gpio13.
How I can read temp from this GPIO?

Re: How to connect DS18B20 on other GPIO?

PostPosted: Wed Sep 21, 2016 1:03 pm
by livetv
Right now the handler for it is hot-wired to GPIO2. This was to accommodate ESP-01 users who have only a couple GPIOs to play with. This pin is determined early in the initialization process and unless a command was going to be added to explicitly change it, that's the way it will stay. I'd also like to run my temp sensors on a different pin but I'd rather not inconvenience the other users who need it where it is.

One possibility would be to create a system variable set from the Settings page for the desired GPIO. That variable can be read when the interpreter initializes. If blank, it defaults to GPIO2 but if there's another value in there, that other pin is used instead.