Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By hakha4
#34359 I have setup where pin 2 is connected to DS1820 sensors and want to use pin 1 for relay output. Everything works ok reading temps but if I set pinMode(1, OUTPUT); in void setup it compiles ok but sketch won't run and only garbage after reset. I believe I've seen a workaround for this but I can't find it anymore. Can someone give a hint how to solve this ?
Regards Håkan
User avatar
By Barnabybear
#34360 Hi, the ESP8266-01 only has GPIOs 0 & 2 broken out. I'm sure GPIO 1 (in normal mode) is Tx or Rx cant remember which, but you can change it to use as a GPIO if you wish but I dont think thats what your wanting to do.
You can use GPIO 0 for the relay but it needs to be between Vcc & the GPIO or it wont boot correctly (this inverts the output) . Drive the GPIO high for off & low for on.
Last edited by Barnabybear on Wed Nov 18, 2015 9:46 am, edited 1 time in total.
User avatar
By hakha4
#34449 Thank's for reply,my fault,mixed up pin 0 and 1'! Compiles ok now.

Barnabybear wrote :
You can use GPIO 0 for the relay but it needs to be between Vcc & the GPIO

Should I use a pullup resistor to Vcc? Value ??
Regards Håkan