Configuring the hardware
Let's now assemble the project:
First, place the ESP8266 module on the breadboard, along with the OLED screen.
Then, connect the power to the OLED screen: connect VIN to the 3.3V pin of the ESP8266, and GND to GND.
Next, we are going to connect the I2C pins the screen to the ESP8266. Connect the DATA pin of the screen to pin 14 of the ESP8266, and the CLK pin of the screen to pin 12 of the ESP8266.
Note
Note that some OLED screens can be configured to either use SPI or I2C. Make sure that your screen is configured to use I2C. This might require some soldering, depending on the brand of your display.
Finally, connect the RST pin of the OLED screen to pin 2 of the ESP8266 board. I found out that this is only necessary if you are having issues with the screen, but to be safe, connect this pin.
This is the final result: