There is an Arduino sketch that runs on the ATMEGA328P part that communicates to the ESP8266 over I2C as a slave. The ESP8266 can use it as an I/O expander... you can also develop your own code to run on the part and even off load processing for what ever you wanted, and tie it all back into the Virual I/O system, so your ESP8266 code remains simple.
That said you could also run all your main code in the ATMEGA and use the ESP98266 as a slave! Maybe using it in AT+ command mode.... its up to you!
Richard.
https://epartsconnect.com
Live realtime stock market prediction website. https://www.stocksignalslive.com my latest creation. Uses AI and machine learning.
New site featuring ESP8266 and ESP32 projects. tutorials, and news.
http://EverythingESP.com
ESP8266.com Founder and Administrator
The Mind Factory (get more from your 3D printer)
Home of the ESP8266, ESP8285, and ESP32 microcontrollers....