Using one ESP8266 for input+output


Is there any way to use one ESP8266 and have input and output connected to it?
For example, if I want to use it for the light switch in the way the videos on youtube describe I need to have one for input and one for output, I was reading the ESP8266 for the door sensor and sprinkler system and noticed for the sensor it uses “outTopic” and for the other one"suscribeTopic" and for the sprinkler system there is one line which is not on the other code “client.subscribe(subscribeTopic);”
I tried to combine the two but it’s not working.
If you have the solution please share it. thanks


Are you talking about MQTT or hardware?


My question was about MQTT
Sorry I forgot to mention it


Yeah. you can. i think there is an example in the pubSub client examples folder in the Arduino IDE.


Thank you, i will check this out


i have that working if You want i can send my firmware!!!


First I’m sorry for not checking for a long time, And I will be very thankful if you do it.