Based on the ideas and work of others, I created this small software project.
It was a challenge to use the Arduino IDE with a ESP8266-01 and a I2C Oled display.
While working with a ESP8266 WiFi module it was a drag using the AT commands. The alternative, using LUA was a step forward but it was the lack of time to get enough knowledge of LUA that I could use it in the same way as I use the C language.
So I was very happy to find the ESP8266-Arduino IDE . Now the ESP-module can easily be used without Arduino board.
But a lot of libraries do not compile in the ESP-IDE. Using the fmalpartida lib for I2C-LCD was a no-go. Also all the libraries for oled's I tested gave errors. (ADAFruit-SSD1306 and U8glib). But the Oled-functions found in Mike Rankin,s project do compile. (Apparently he extracted the functions from the AdafruitSSD1306 library). This sketch https://www.youtube.com/watch?v=iRMdj3dS2hc gave me the idea to make this project.
Initially my sketch only worked for oled's with a SDD1306 controller, which are found in most of the tiny 0.96 inch blue or white I2C Oleds.
I have changed it so that Oled's with a SH1106 controller can also be used. The SH1106 is much like the SSD1306 , the main difference is the memory map which is 128*64 for the SSD1306 and is 132*64 for the SH1106 controller resulting often in a small white or noisy sideband of pixels. The 1.3 inch SPI/I2C Oled I have has 2 solderable jumpers by which the display can be set for 3SPI, 4SPI or I2C. To work with the ESP I changed the jumpers for I2C (S1=0 S2=1)
The difference in the sketch is that the clear function has to clear 8x132 bytes vs. 8*128 bytes. Also the setXY() function needs an lower colom adress offset of 0x02. The right offset value has to enabled in the declaration_part of the ESP_Messenger_v1.0 file
Ofcourse you have to specify your own WiFi SSID and Password in the sketch before you upload it.
On startup you will see the SSID and the local-IP of the ESP which can be used to send messages. Open a browser and type this local-IP, a simple webpage opens where you can submit a message of up to 128 characters.
Connect the Oled SCL to GPIO2, Oled SDA to GPIO0.
Be sure you have a original I2C Oled with a SSD1306 controller. Other controllers may not work.
Up from version 1.0 it works also for OLED's with SH1106 controllers.