{"id":814,"date":"2022-09-18T12:28:07","date_gmt":"2022-09-18T12:28:07","guid":{"rendered":"https:\/\/esp32tutorials.com\/?p=814"},"modified":"2022-09-18T12:28:10","modified_gmt":"2022-09-18T12:28:10","slug":"oled-esp32-esp-idf-tutorial","status":"publish","type":"post","link":"https:\/\/esp32tutorials.com\/oled-esp32-esp-idf-tutorial\/","title":{"rendered":"Interface OLED with ESP32 using ESP-IDF"},"content":{"rendered":"\n<p>In this ESP-IDF tutorial, we will show you how to interface SSD1306 OLED with ESP32. Organic Light Emitting Diode commonly known as OLED is used to display texts, bitmap images, and shapes. Due to its cost-effective nature and great view angle and pixel density. This guide includes a brief introduction to the 0.96-inch OLED display, interfacing with the ESP32 board, and then using <strong>SSD1306\/SH1106 Driver for ESP-IDF<\/strong> to display texts, scrolling text, images, and animations on the OLED display.<\/p>\n\n\n\n<p>Before we move ahead, make sure you have the latest version of VS Code installed on your system with the ESP-IDF extension configured.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/esp32tutorials.com\/install-esp32-esp-idf-windows-integrate-vs-code\/\">Install ESP32 ESP-IDF on Windows<\/a><\/li><li><a href=\"https:\/\/esp32tutorials.com\/install-esp32-esp-idf-linux-ubuntu\/\">Install ESP32 ESP-IDF on Linux Ubuntu<\/a><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"oled-display-introduction\">SSD1306 0.96 inch OLED Display Introduction<\/h2>\n\n\n\n<p>An OLED is an organic light-emitting diode that consists of two organic thin films connected in series between two electric conductors. There are several versions of OLED displays available in the market. This guide focuses on SSD1306 0.96 inch OLED display which has 128&#215;64 pixels. The SSD1306 controller is the major component of thus display, which allows I2C\/SPI communication between microcontrollers. The OLED we will be using communicates through I2C only thus it has four pins that need to be connected with the ESP32 board.<\/p>\n\n\n\n<p>The diagram below shows the pinout of the OLED display we will be using.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"636\" height=\"626\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/OLED-Pinout-I2C.jpg?resize=636%2C626&#038;ssl=1\" alt=\"OLED Pinout I2C\" class=\"wp-image-821\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/OLED-Pinout-I2C.jpg?w=636&amp;ssl=1 636w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/OLED-Pinout-I2C.jpg?resize=300%2C295&amp;ssl=1 300w\" sizes=\"auto, (max-width: 636px) 100vw, 636px\" \/><figcaption>Pinout of 0.96-inch OLED (I2C only)<\/figcaption><\/figure>\n<\/div>\n\n\n<p>As you can view in the pinout above, this OLED has 4 pins. This display requires a driving voltage of 3.3-5V. The VCC and GND pins are the power supply pins of the OLED connected with ESP32 Vin or 3.3V pin. The SCL and SDA pins are the I2C pins required to generate the clock signal and transmit the data respectively. These two pins will be connected with the I2C pins of the ESP32 board.<\/p>\n\n\n\n<p>The table below shows some key specifications of this model.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Size<\/th><th>0.96 inch<\/th><\/tr><\/thead><tbody><tr><td>Terminals<\/td><td>4<\/td><\/tr><tr><td>Pixels<\/td><td>128\u00d764<\/td><\/tr><tr><td>Communication<\/td><td>I2C only<\/td><\/tr><tr><td>VCC<\/td><td>3.3V-5V<\/td><\/tr><tr><td>Operating Temperature<\/td><td>-40\u2103 to +80\u2103<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Refer to the following article for an in-depth introduction to 0.96-inch OLED:\u00a0<a href=\"https:\/\/microcontrollerslab.com\/oled-display-pinout-interfacing-arduino-applications-features\/\" target=\"_blank\" rel=\"noopener\">Monochrome 0.96\u201d OLED Display<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"interfacing-oled-display-esp32\">ESP-IDF Interface OLED with ESP32<\/h2>\n\n\n\n<p>In this section, we will connect the SSD1306 OLED display with the ESP32 development board. Follow the connections as shown in the table below:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>ESP32 board<\/th><th>SSD1306 OLED Display<\/th><\/tr><\/thead><tbody><tr><td>3.3V or Vin<\/td><td>VCC<\/td><\/tr><tr><td>GPIO21(I2C SDA)<\/td><td>SDA<\/td><\/tr><tr><td>GPIO22(I2C SCL)<\/td><td>SCL<\/td><\/tr><tr><td>GND<\/td><td>GND<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>As we mentioned previously, the OLED display requires an operating voltage of 3.3-5V hence we can connect either the 3.3V pin or the Vin pin of the ESP32 module with the VCC pin of the display. The GND pins of both the pins will be common. To connect the I2C pins, we will use the default I2C pins of the ESP32 board. By default in ESP32, GPIO22 is set up as SCL pin and GPIO21 is set up as SDA pin. Therefore, we will connect SDA pin of display with GPIO21 and SCL pin of display with GPIO22.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"696\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-I2C-Pins.jpg?resize=1024%2C696&#038;ssl=1\" alt=\"ESP32 I2C Pins\" class=\"wp-image-835\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-I2C-Pins.jpg?resize=1024%2C696&amp;ssl=1 1024w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-I2C-Pins.jpg?resize=300%2C204&amp;ssl=1 300w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-I2C-Pins.jpg?resize=768%2C522&amp;ssl=1 768w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-I2C-Pins.jpg?w=1135&amp;ssl=1 1135w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"esp32-connections-oled\">ESP32 OLED Connection Diagram<\/h3>\n\n\n\n<p>The diagram below shows the connections between ESP32 board and OLED display. We have used the same connections as we described above.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"646\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-with-OLED-schematic-diagram.jpg?resize=1024%2C646&#038;ssl=1\" alt=\"ESP32 with OLED schematic diagram\" class=\"wp-image-836\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-with-OLED-schematic-diagram.jpg?resize=1024%2C646&amp;ssl=1 1024w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-with-OLED-schematic-diagram.jpg?resize=300%2C189&amp;ssl=1 300w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-with-OLED-schematic-diagram.jpg?resize=768%2C485&amp;ssl=1 768w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-with-OLED-schematic-diagram.jpg?w=1192&amp;ssl=1 1192w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Connection diagram for ESP32 and OLED Display<\/figcaption><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-station-mode-vs-soft-ap-mode\">ESP-IDF ESP32 OLED Display and Scroll Text<\/h2>\n\n\n\n<p>Let&#8217;s set up a project in ESP-IDF to test our SSD1306 OLED display. We will demonstrate TextDemo by nopnop2002 uploaded on GitHub at the following link: <\/p>\n\n\n\n<div class=\"wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-16018d1d wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button has-custom-width wp-block-button__width-25\"><a class=\"wp-block-button__link has-midnight-gradient-background has-background\" href=\"https:\/\/github.com\/nopnop2002\/esp-idf-ssd1306\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>DOWNLOAD<\/strong><\/a><\/div>\n<\/div>\n\n\n\n<p>These examples use the SSD1306\/SH1106 Driver for ESP-IDF.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Create Project<\/h3>\n\n\n\n<p>Open your VS Code and head over to&nbsp;<strong>View &gt; Command Palette<\/strong>. Type&nbsp;<strong>ESP-IDF: New Project<\/strong>&nbsp;in the search bar and press enter.<\/p>\n\n\n\n<p>Specify the project name and directory. We have named our project \u2018ESP_IDF_ssd1306_TextDemo.\u2019 For the ESP-IDF board, we have chosen the custom board option. For ESP-IDF target, we have chosen ESP32 module. Click \u2018Choose Template\u2019 button to proceed forward.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"632\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-1.jpg?resize=1024%2C632&#038;ssl=1\" alt=\"ESP32 OLED using ESP-IDF TextDemo project 1\" class=\"wp-image-840\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-1.jpg?resize=1024%2C632&amp;ssl=1 1024w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-1.jpg?resize=300%2C185&amp;ssl=1 300w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-1.jpg?resize=768%2C474&amp;ssl=1 768w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-1.jpg?w=1231&amp;ssl=1 1231w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>In the Extension, select ESP-IDF option:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1347\" height=\"549\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-2.jpg?resize=1024%2C417&amp;ssl=1\" alt=\"ESP-IDF in VS Code New Project 2\" class=\"wp-image-78\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-2.jpg?w=1347&amp;ssl=1 1347w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-2.jpg?resize=300%2C122&amp;ssl=1 300w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-2.jpg?resize=1024%2C417&amp;ssl=1 1024w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-2.jpg?resize=768%2C313&amp;ssl=1 768w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p>We will click the \u2018sample_project\u2019 under the get-started tab. Now click \u2018Create project using template sample_project.\u2019<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1267\" height=\"748\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-3.jpg?resize=1024%2C605&amp;ssl=1\" alt=\"ESP-IDF in VS Code New Project 3\" class=\"wp-image-79\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-3.jpg?w=1267&amp;ssl=1 1267w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-3.jpg?resize=300%2C177&amp;ssl=1 300w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-3.jpg?resize=1024%2C605&amp;ssl=1 1024w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-3.jpg?resize=768%2C453&amp;ssl=1 768w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p>You will get a notification that the project has been created. To open the project in a new window, click \u2018Yes.\u2019<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Add Libraries<\/h3>\n\n\n\n<p>This opens esp-idf project that we created, inside the EXPLORER tab. There are several folders inside our project folder. This is the same for every project which you will create through ESP-IDF Explorer. Create a new folder named &#8216;<strong>components<\/strong>&#8216; and copy the files from the link given below into your project components folder. This will contain the libraries that will be required for this project.<\/p>\n\n\n\n<div class=\"wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-16018d1d wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button has-custom-width wp-block-button__width-25\"><a class=\"wp-block-button__link has-midnight-gradient-background has-background\" href=\"https:\/\/github.com\/nopnop2002\/esp-idf-ssd1306\/tree\/master\/components\/ssd1306\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>DOWNLOAD<\/strong><\/a><\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">OLED MenuConfig Settings ESP-IDF<\/h3>\n\n\n\n<p>Let&#8217;s first head over to the <strong>menuconfig<\/strong>. Opens the ESP-IDF SDK Configuration Editor. Scroll down and open the <strong>SSD1306 Configuration<\/strong>. Here we can set the SSD1306 configuration parameter according to our needs. This includes the UART interface, panel type, SCL GPIO pin, SDA GPIO pin and the reset GPIO pin. Here you can view that by default, ESP-IDF is using the interface as I2C, panel type as 128&#215;64, SCL GPIO pin as 22, SDA GPIO pin as 21 and Reset GPIO pin as 33. You can alter these parameters according to your OLED display and then click the Save button found at the top. We will leave the configuration settings as default as they match our module.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"556\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-SDK-configuration-editor-1024x556.jpg?resize=1024%2C556&#038;ssl=1\" alt=\"ESP32 OLED using ESP-IDF TextDemo project SDK configuration editor\" class=\"wp-image-845\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-SDK-configuration-editor.jpg?resize=1024%2C556&amp;ssl=1 1024w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-SDK-configuration-editor.jpg?resize=300%2C163&amp;ssl=1 300w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-SDK-configuration-editor.jpg?resize=768%2C417&amp;ssl=1 768w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-SDK-configuration-editor.jpg?w=1333&amp;ssl=1 1333w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>Alternatively, we can also set this config value with menuconfig. Open menuconfig by typing <strong>idf.py menuconfig<\/strong> in the terminal. This command opens the Espressif IoT Development Framework Configuration. Head over to <strong>SSD1306 Configuration<\/strong> and set the parameters accordingly.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Code<\/h3>\n\n\n\n<p>The\u00a0<strong>main<\/strong>\u00a0folder contains the source code meaning the main.c file will be found here. Inside the main.c we will write our program code. Go to\u00a0<strong>main > main.c\u00a0<\/strong>and open it. We will define the functions and the program code here. Copy the code from this link here.<\/p>\n\n\n\n<div class=\"wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-16018d1d wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button has-custom-width wp-block-button__width-25\"><a class=\"wp-block-button__link has-midnight-gradient-background has-background\" href=\"https:\/\/github.com\/nopnop2002\/esp-idf-ssd1306\/blob\/master\/TextDemo\/main\/main.c\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>DOWNLOAD<\/strong><\/a><\/div>\n<\/div>\n\n\n\n<p>This is our <strong>main.c<\/strong> file.<\/p>\n\n\n\n<p class=\"has-base-3-color has-text-color has-background\" style=\"background-color:#e31111\">Note: All examples and library for this tutorial are taken from this <a href=\"https:\/\/github.com\/nopnop2002\/esp-idf-ssd1306\" target=\"_blank\" rel=\"noopener\" title=\"GitHub \"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-base-3-color\"><strong><span style=\"text-decoration: underline;\">GitHub <\/span><\/strong><\/mark><\/a>repo.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code class=\"\">#include &lt;stdio.h&gt;\n#include &lt;stdlib.h&gt;\n#include &lt;string.h&gt;\n#include \"freertos\/FreeRTOS.h\"\n#include \"freertos\/task.h\"\n#include \"esp_log.h\"\n\n#include \"ssd1306.h\"\n#include \"font8x8_basic.h\"\n\n\/*\n You have to set this config value with menuconfig\n CONFIG_INTERFACE\n for i2c\n CONFIG_MODEL\n CONFIG_SDA_GPIO\n CONFIG_SCL_GPIO\n CONFIG_RESET_GPIO\n for SPI\n CONFIG_CS_GPIO\n CONFIG_DC_GPIO\n CONFIG_RESET_GPIO\n*\/\n\n#define tag \"SSD1306\"\n\nvoid app_main(void)\n{\n\tSSD1306_t dev;\n\tint center, top, bottom;\n\tchar lineChar[20];\n\n#if CONFIG_I2C_INTERFACE\n\tESP_LOGI(tag, \"INTERFACE is i2c\");\n\tESP_LOGI(tag, \"CONFIG_SDA_GPIO=%d\",CONFIG_SDA_GPIO);\n\tESP_LOGI(tag, \"CONFIG_SCL_GPIO=%d\",CONFIG_SCL_GPIO);\n\tESP_LOGI(tag, \"CONFIG_RESET_GPIO=%d\",CONFIG_RESET_GPIO);\n\ti2c_master_init(&amp;dev, CONFIG_SDA_GPIO, CONFIG_SCL_GPIO, CONFIG_RESET_GPIO);\n#endif \/\/ CONFIG_I2C_INTERFACE\n\n#if CONFIG_SPI_INTERFACE\n\tESP_LOGI(tag, \"INTERFACE is SPI\");\n\tESP_LOGI(tag, \"CONFIG_MOSI_GPIO=%d\",CONFIG_MOSI_GPIO);\n\tESP_LOGI(tag, \"CONFIG_SCLK_GPIO=%d\",CONFIG_SCLK_GPIO);\n\tESP_LOGI(tag, \"CONFIG_CS_GPIO=%d\",CONFIG_CS_GPIO);\n\tESP_LOGI(tag, \"CONFIG_DC_GPIO=%d\",CONFIG_DC_GPIO);\n\tESP_LOGI(tag, \"CONFIG_RESET_GPIO=%d\",CONFIG_RESET_GPIO);\n\tspi_master_init(&amp;dev, CONFIG_MOSI_GPIO, CONFIG_SCLK_GPIO, CONFIG_CS_GPIO, CONFIG_DC_GPIO, CONFIG_RESET_GPIO);\n#endif \/\/ CONFIG_SPI_INTERFACE\n\n#if CONFIG_FLIP\n\tdev._flip = true;\n\tESP_LOGW(tag, \"Flip upside down\");\n#endif\n\n#if CONFIG_SSD1306_128x64\n\tESP_LOGI(tag, \"Panel is 128x64\");\n\tssd1306_init(&amp;dev, 128, 64);\n#endif \/\/ CONFIG_SSD1306_128x64\n#if CONFIG_SSD1306_128x32\n\tESP_LOGI(tag, \"Panel is 128x32\");\n\tssd1306_init(&amp;dev, 128, 32);\n#endif \/\/ CONFIG_SSD1306_128x32\n\n\tssd1306_clear_screen(&amp;dev, false);\n\tssd1306_contrast(&amp;dev, 0xff);\n  ssd1306_display_text_x3(&amp;dev, 0, \"Hello\", 5, false);\n  vTaskDelay(3000 \/ portTICK_PERIOD_MS);\n\n#if CONFIG_SSD1306_128x64\n\ttop = 2;\n\tcenter = 3;\n\tbottom = 8;\n\tssd1306_display_text(&amp;dev, 0, \"SSD1306 128x64\", 14, false);\n\tssd1306_display_text(&amp;dev, 1, \"ABCDEFGHIJKLMNOP\", 16, false);\n\tssd1306_display_text(&amp;dev, 2, \"abcdefghijklmnop\",16, false);\n\tssd1306_display_text(&amp;dev, 3, \"Hello World!!\", 13, false);\n\t\/\/ssd1306_clear_line(&amp;dev, 4, true);\n\t\/\/ssd1306_clear_line(&amp;dev, 5, true);\n\t\/\/ssd1306_clear_line(&amp;dev, 6, true);\n\t\/\/ssd1306_clear_line(&amp;dev, 7, true);\n\tssd1306_display_text(&amp;dev, 4, \"SSD1306 128x64\", 14, true);\n\tssd1306_display_text(&amp;dev, 5, \"ABCDEFGHIJKLMNOP\", 16, true);\n\tssd1306_display_text(&amp;dev, 6, \"abcdefghijklmnop\",16, true);\n\tssd1306_display_text(&amp;dev, 7, \"Hello World!!\", 13, true);\n#endif \/\/ CONFIG_SSD1306_128x64\n\n#if CONFIG_SSD1306_128x32\n\ttop = 1;\n\tcenter = 1;\n\tbottom = 4;\n\tssd1306_display_text(&amp;dev, 0, \"SSD1306 128x32\", 14, false);\n\tssd1306_display_text(&amp;dev, 1, \"Hello World!!\", 13, false);\n\t\/\/ssd1306_clear_line(&amp;dev, 2, true);\n\t\/\/ssd1306_clear_line(&amp;dev, 3, true);\n\tssd1306_display_text(&amp;dev, 2, \"SSD1306 128x32\", 14, true);\n\tssd1306_display_text(&amp;dev, 3, \"Hello World!!\", 13, true);\n#endif \/\/ CONFIG_SSD1306_128x32\n\tvTaskDelay(3000 \/ portTICK_PERIOD_MS);\n\t\n\t\/\/ Display Count Down\n\tuint8_t image[24];\n\tmemset(image, 0, sizeof(image));\n\tssd1306_display_image(&amp;dev, top, (6*8-1), image, sizeof(image));\n\tssd1306_display_image(&amp;dev, top+1, (6*8-1), image, sizeof(image));\n\tssd1306_display_image(&amp;dev, top+2, (6*8-1), image, sizeof(image));\n\tfor(int font=0x39;font&gt;0x30;font--) {\n\t\tmemset(image, 0, sizeof(image));\n\t\tssd1306_display_image(&amp;dev, top+1, (7*8-1), image, 8);\n\t\tmemcpy(image, font8x8_basic_tr[font], 8);\n\t\tif (dev._flip) ssd1306_flip(image, 8);\n\t\tssd1306_display_image(&amp;dev, top+1, (7*8-1), image, 8);\n\t\tvTaskDelay(1000 \/ portTICK_PERIOD_MS);\n\t}\n\t\n\t\/\/ Scroll Up\n\tssd1306_clear_screen(&amp;dev, false);\n\tssd1306_contrast(&amp;dev, 0xff);\n\tssd1306_display_text(&amp;dev, 0, \"---Scroll  UP---\", 16, true);\n\t\/\/ssd1306_software_scroll(&amp;dev, 7, 1);\n\tssd1306_software_scroll(&amp;dev, (dev._pages - 1), 1);\n\tfor (int line=0;line&lt;bottom+10;line++) {\n\t\tlineChar[0] = 0x01;\n\t\tsprintf(&amp;lineChar[1], \" Line %02d\", line);\n\t\tssd1306_scroll_text(&amp;dev, lineChar, strlen(lineChar), false);\n\t\tvTaskDelay(500 \/ portTICK_PERIOD_MS);\n\t}\n\tvTaskDelay(3000 \/ portTICK_PERIOD_MS);\n\t\n\t\/\/ Scroll Down\n\tssd1306_clear_screen(&amp;dev, false);\n\tssd1306_contrast(&amp;dev, 0xff);\n\tssd1306_display_text(&amp;dev, 0, \"--Scroll  DOWN--\", 16, true);\n\t\/\/ssd1306_software_scroll(&amp;dev, 1, 7);\n\tssd1306_software_scroll(&amp;dev, 1, (dev._pages - 1) );\n\tfor (int line=0;line&lt;bottom+10;line++) {\n\t\tlineChar[0] = 0x02;\n\t\tsprintf(&amp;lineChar[1], \" Line %02d\", line);\n\t\tssd1306_scroll_text(&amp;dev, lineChar, strlen(lineChar), false);\n\t\tvTaskDelay(500 \/ portTICK_PERIOD_MS);\n\t}\n\tvTaskDelay(3000 \/ portTICK_PERIOD_MS);\n\n\t\/\/ Page Down\n\tssd1306_clear_screen(&amp;dev, false);\n\tssd1306_contrast(&amp;dev, 0xff);\n\tssd1306_display_text(&amp;dev, 0, \"---Page\tDOWN---\", 16, true);\n\tssd1306_software_scroll(&amp;dev, 1, (dev._pages-1) );\n\tfor (int line=0;line&lt;bottom+10;line++) {\n\t\t\/\/if ( (line % 7) == 0) ssd1306_scroll_clear(&amp;dev);\n\t\tif ( (line % (dev._pages-1)) == 0) ssd1306_scroll_clear(&amp;dev);\n\t\tlineChar[0] = 0x02;\n\t\tsprintf(&amp;lineChar[1], \" Line %02d\", line);\n\t\tssd1306_scroll_text(&amp;dev, lineChar, strlen(lineChar), false);\n\t\tvTaskDelay(500 \/ portTICK_PERIOD_MS);\n\t}\n\tvTaskDelay(3000 \/ portTICK_PERIOD_MS);\n\n\t\/\/ Horizontal Scroll\n\tssd1306_clear_screen(&amp;dev, false);\n\tssd1306_contrast(&amp;dev, 0xff);\n\tssd1306_display_text(&amp;dev, center, \"Horizontal\", 10, false);\n\tssd1306_hardware_scroll(&amp;dev, SCROLL_RIGHT);\n\tvTaskDelay(5000 \/ portTICK_PERIOD_MS);\n\tssd1306_hardware_scroll(&amp;dev, SCROLL_LEFT);\n\tvTaskDelay(5000 \/ portTICK_PERIOD_MS);\n\tssd1306_hardware_scroll(&amp;dev, SCROLL_STOP);\n\t\n\t\/\/ Vertical Scroll\n\tssd1306_clear_screen(&amp;dev, false);\n\tssd1306_contrast(&amp;dev, 0xff);\n\tssd1306_display_text(&amp;dev, center, \"Vertical\", 8, false);\n\tssd1306_hardware_scroll(&amp;dev, SCROLL_DOWN);\n\tvTaskDelay(5000 \/ portTICK_PERIOD_MS);\n\tssd1306_hardware_scroll(&amp;dev, SCROLL_UP);\n\tvTaskDelay(5000 \/ portTICK_PERIOD_MS);\n\tssd1306_hardware_scroll(&amp;dev, SCROLL_STOP);\n\t\n\t\/\/ Invert\n\tssd1306_clear_screen(&amp;dev, true);\n\tssd1306_contrast(&amp;dev, 0xff);\n\tssd1306_display_text(&amp;dev, center, \"  Good Bye!!\", 12, true);\n\tvTaskDelay(5000 \/ portTICK_PERIOD_MS);\n\n\n\t\/\/ Fade Out\n\tssd1306_fadeout(&amp;dev);\n\t\n#if 0\n\t\/\/ Fade Out\n\tfor(int contrast=0xff;contrast&gt;0;contrast=contrast-0x20) {\n\t\tssd1306_contrast(&amp;dev, contrast);\n\t\tvTaskDelay(40);\n\t}\n#endif\n\n\t\/\/ Restart module\n\tesp_restart();\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">How the Code Works?<\/h3>\n\n\n\n<p class=\"has-base-3-color has-accent-2-background-color has-text-color has-background\">Note: This code is applicable for OLED displays with different panel types and interfaces. The #if #endif conditions will work according to the particular parameter defined. Hence, we will look at those parts which are applicable to our SSD1306 Configuration parameters.<\/p>\n\n\n\n<p>Firstly, the code starts by including the necessary libraries that includes the FreeRTOS libraries to generate delays, ssd1306.h driver for the OLED functionality, font8x8_basic.h which contains 8&#215;8 pixels ASCII font set and esp_log.h for debugging. <\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code class=\"\">#include &lt;stdio.h&gt;\n#include &lt;stdlib.h&gt;\n#include &lt;string.h&gt;\n#include \"freertos\/FreeRTOS.h\"\n#include \"freertos\/task.h\"\n#include \"esp_log.h\"\n\n#include \"ssd1306.h\"\n#include \"font8x8_basic.h\"<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Initialize I2C interface and OLED<\/h4>\n\n\n\n<p>Inside the app_main() function, firstly the I2C interface is configured. The current settings that we setup in the menuconfig will get printed in the terminal. This includes the interface type, SDA GPIO, SCL GPIO and Reset GPIO. Moreover, the I2C interface will be configured by calling the <strong>i2c_master_init()<\/strong> function and passing the address of the SSD1306_t structure, SDA pin, SCL pin and Reset pin as parameters inside it. <\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code class=\"\">#if CONFIG_I2C_INTERFACE\n\tESP_LOGI(tag, \"INTERFACE is i2c\");\n\tESP_LOGI(tag, \"CONFIG_SDA_GPIO=%d\",CONFIG_SDA_GPIO);\n\tESP_LOGI(tag, \"CONFIG_SCL_GPIO=%d\",CONFIG_SCL_GPIO);\n\tESP_LOGI(tag, \"CONFIG_RESET_GPIO=%d\",CONFIG_RESET_GPIO);\n\ti2c_master_init(&amp;dev, CONFIG_SDA_GPIO, CONFIG_SCL_GPIO, CONFIG_RESET_GPIO);\n#endif \/\/ CONFIG_I2C_INTERFACE<\/code><\/pre>\n\n\n\n<p>The following statement will print the panel type  on the terminal. Moreover, it will also initialize the OLED display by calling <strong>ssd1306_init()<\/strong> function. This takes in three parameters. The first parameter is the address of the SSD1306_t structure, the second parameter is the width and the third parameter is the height of the display in pixels. We are using a 128\u00d764 display hence the width is 128 and the height is 64.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code class=\"\">#if CONFIG_SSD1306_128x64\n\tESP_LOGI(tag, \"Panel is 128x64\");\n\tssd1306_init(&amp;dev, 128, 64);\n#endif \/\/ CONFIG_SSD1306_128x64<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Clear Screen and Set Contrast<\/h4>\n\n\n\n<p>Next, we have a few function calls. First the screen of the OLED display is cleared using <strong>ssd1306_clear_screen()<\/strong>. This function takes in two parameters. The first is the address of the SSD1306_t structure and the second parameter is invert which is a bool variable. It is set as false. This means we have a dark background and the text will be displayed in white. <\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code class=\"\">ssd1306_clear_screen(&amp;dev, false);<\/code><\/pre>\n\n\n\n<p>Secondly, the contrast of the screen is set using <strong>ssd1306_contrast()<\/strong>. This function takes in two parameters. The first is the address of the SSD1306_t structure and the second parameter is the contrast value which is an int variable. It is set as 0xff.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code class=\"\">ssd1306_contrast(&amp;dev, 0xff);<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Display Text<\/h4>\n\n\n\n<p>Then, the screen displays the text &#8216;Hello&#8217; by calling the function <strong>ssd1306_display_text_x3()<\/strong>. This will be displayed on the screen for three seconds. It takes in five parameters. The first parameter is the address of the SSD1306_t structure. The second parameter is the page number of the composition data which is set as 0. The third parameter is the text that we want to display. It is &#8220;Hello&#8221; in this case. The fourth parameter is the length of the text which is specified as 5. Lastly, the fifth parameter is invert which is a bool variable. It is set as false. This means we have a dark background and the text will be displayed in white.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code class=\"\">  ssd1306_display_text_x3(&amp;dev, 0, \"Hello\", 5, false);\n  vTaskDelay(3000 \/ portTICK_PERIOD_MS);<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"407\" height=\"293\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-Display-Text.jpg?resize=407%2C293&#038;ssl=1\" alt=\"ESP32 OLED using ESP-IDF TextDemo project Display Text\" class=\"wp-image-872\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-Display-Text.jpg?w=407&amp;ssl=1 407w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-Display-Text.jpg?resize=300%2C216&amp;ssl=1 300w\" sizes=\"auto, (max-width: 407px) 100vw, 407px\" \/><\/figure>\n<\/div>\n\n\n<h4 class=\"wp-block-heading\">Display Text and Invert <\/h4>\n\n\n\n<p>Next we have another block of code for the SSD1306 128&#215;64 configuration. This displays a series of texts that fill the whole screen. We start by defining the top, center and bottom values. Then we call <strong>ssd_1306_display_text()<\/strong> several times to display various messages with invert values as both false and true. When the invert is set as false, we have a dark background and the text will be displayed in white. Likewise, when the invert is set as true, we have a bright background and the text is displayed in black. This function takes the same parameters as ssd1306_display_text_x3().<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code class=\"\">#if CONFIG_SSD1306_128x64\n\ttop = 2;\n\tcenter = 3;\n\tbottom = 8;\n\tssd1306_display_text(&amp;dev, 0, \"SSD1306 128x64\", 14, false);\n\tssd1306_display_text(&amp;dev, 1, \"ABCDEFGHIJKLMNOP\", 16, false);\n\tssd1306_display_text(&amp;dev, 2, \"abcdefghijklmnop\",16, false);\n\tssd1306_display_text(&amp;dev, 3, \"Hello World!!\", 13, false);\n\n\tssd1306_display_text(&amp;dev, 4, \"SSD1306 128x64\", 14, true);\n\tssd1306_display_text(&amp;dev, 5, \"ABCDEFGHIJKLMNOP\", 16, true);\n\tssd1306_display_text(&amp;dev, 6, \"abcdefghijklmnop\",16, true);\n\tssd1306_display_text(&amp;dev, 7, \"Hello World!!\", 13, true);\n#endif \/\/ CONFIG_SSD1306_128x64<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"367\" height=\"300\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-Display-Text-and-Invert.jpg?resize=367%2C300&#038;ssl=1\" alt=\"ESP32 OLED using ESP-IDF TextDemo project Display Text and Invert\" class=\"wp-image-873\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-Display-Text-and-Invert.jpg?w=367&amp;ssl=1 367w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-Display-Text-and-Invert.jpg?resize=300%2C245&amp;ssl=1 300w\" sizes=\"auto, (max-width: 367px) 100vw, 367px\" \/><\/figure>\n<\/div>\n\n\n<h4 class=\"wp-block-heading\">Display Numbers<\/h4>\n\n\n\n<p>Next we will display a series of numbers in the middle of the screen that will count down form 9 to 0. Each number will stay on the screen for a second and then it will disappear and the next number appears in its place.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code class=\"\">\t\/\/ Display Count Down\n\tuint8_t image[24];\n\tmemset(image, 0, sizeof(image));\n\tssd1306_display_image(&amp;dev, top, (6*8-1), image, sizeof(image));\n\tssd1306_display_image(&amp;dev, top+1, (6*8-1), image, sizeof(image));\n\tssd1306_display_image(&amp;dev, top+2, (6*8-1), image, sizeof(image));\n\tfor(int font=0x39;font&gt;0x30;font--) {\n\t\tmemset(image, 0, sizeof(image));\n\t\tssd1306_display_image(&amp;dev, top+1, (7*8-1), image, 8);\n\t\tmemcpy(image, font8x8_basic_tr[font], 8);\n\t\tif (dev._flip) ssd1306_flip(image, 8);\n\t\tssd1306_display_image(&amp;dev, top+1, (7*8-1), image, 8);\n\t\tvTaskDelay(1000 \/ portTICK_PERIOD_MS);\n\t}<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"352\" height=\"295\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-Count-Down.jpg?resize=352%2C295&#038;ssl=1\" alt=\"ESP32 OLED using ESP-IDF TextDemo project Count Down\" class=\"wp-image-874\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-Count-Down.jpg?w=352&amp;ssl=1 352w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-Count-Down.jpg?resize=300%2C251&amp;ssl=1 300w\" sizes=\"auto, (max-width: 352px) 100vw, 352px\" \/><\/figure>\n<\/div>\n\n\n<h4 class=\"wp-block-heading\">Scroll Up and Down<\/h4>\n\n\n\n<p>Now we will scroll some texts up and down the screen. First, we will clear the screen and set the contrast. Then we will display the text &#8220;&#8212;Scroll UP&#8212;&#8220;. Then we call the function ssd1306_software_scroll() and pass three parameters inside it. The first parameter is the address of the SSD1306_t structure. The second parameter is start which is set as (dev._pages &#8211; 1) and the third parameter is end which is set as 1. Then we use a for loop to display a scrolling text that will start from Line 00 and end at Line 17 while scrolling from bottom to top (scroll up). This will be achieved by using the function ssd1306_scroll_text().<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code class=\"\">\/\/ Scroll Up\n\tssd1306_clear_screen(&amp;dev, false);\n\tssd1306_contrast(&amp;dev, 0xff);\n\tssd1306_display_text(&amp;dev, 0, \"---Scroll  UP---\", 16, true);\n\n\tssd1306_software_scroll(&amp;dev, (dev._pages - 1), 1);\n\tfor (int line=0;line&lt;bottom+10;line++) {\n\t\tlineChar[0] = 0x01;\n\t\tsprintf(&amp;lineChar[1], \" Line %02d\", line);\n\t\tssd1306_scroll_text(&amp;dev, lineChar, strlen(lineChar), false);\n\t\tvTaskDelay(500 \/ portTICK_PERIOD_MS);\n\t}\n\tvTaskDelay(3000 \/ portTICK_PERIOD_MS);\n\t\n<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"378\" height=\"311\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-Scroll-Up.jpg?resize=378%2C311&#038;ssl=1\" alt=\"ESP32 OLED using ESP-IDF TextDemo project Scroll Up\" class=\"wp-image-877\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-Scroll-Up.jpg?w=378&amp;ssl=1 378w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-Scroll-Up.jpg?resize=300%2C247&amp;ssl=1 300w\" sizes=\"auto, (max-width: 378px) 100vw, 378px\" \/><\/figure>\n<\/div>\n\n\n<p>After the scroll up is complete we will move to scroll down. First, we will clear the screen and set the contrast. Then we will display the text &#8220;&#8212;Scroll DOWN&#8212;&#8220;. Then we call the function ssd1306_software_scroll() and pass three parameters inside it. The first parameter is the address of the SSD1306_t structure. The second parameter is start which is set as 1 and the third parameter is end which is set as (dev._pages &#8211; 1). Then we use a for loop to display a scrolling text that will start from Line 00 and end at Line 17 while scrolling from top to bottom (scroll down). This will be achieved by using the function ssd1306_scroll_text().<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code class=\"\">\t\/\/ Scroll Down\n\tssd1306_clear_screen(&amp;dev, false);\n\tssd1306_contrast(&amp;dev, 0xff);\n\tssd1306_display_text(&amp;dev, 0, \"--Scroll  DOWN--\", 16, true);\n\t\/\/ssd1306_software_scroll(&amp;dev, 1, 7);\n\tssd1306_software_scroll(&amp;dev, 1, (dev._pages - 1) );\n\tfor (int line=0;line&lt;bottom+10;line++) {\n\t\tlineChar[0] = 0x02;\n\t\tsprintf(&amp;lineChar[1], \" Line %02d\", line);\n\t\tssd1306_scroll_text(&amp;dev, lineChar, strlen(lineChar), false);\n\t\tvTaskDelay(500 \/ portTICK_PERIOD_MS);\n\t}\n\tvTaskDelay(3000 \/ portTICK_PERIOD_MS);<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"331\" height=\"264\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-Scroll-Down.jpg?resize=331%2C264&#038;ssl=1\" alt=\"ESP32 OLED using ESP-IDF TextDemo project Scroll Down\" class=\"wp-image-878\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-Scroll-Down.jpg?w=331&amp;ssl=1 331w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-Scroll-Down.jpg?resize=300%2C239&amp;ssl=1 300w\" sizes=\"auto, (max-width: 331px) 100vw, 331px\" \/><\/figure>\n<\/div>\n\n\n<h4 class=\"wp-block-heading\">Page Down<\/h4>\n\n\n\n<p>Next, we have a section of code for page down. It is similar to scrolling down however in this case the texts do not automatically scroll down but when they reach the end of the screen, they disappear and new ones take their place.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code class=\"\">\/\/ Page Down\n\tssd1306_clear_screen(&amp;dev, false);\n\tssd1306_contrast(&amp;dev, 0xff);\n\tssd1306_display_text(&amp;dev, 0, \"---Page\tDOWN---\", 16, true);\n\tssd1306_software_scroll(&amp;dev, 1, (dev._pages-1) );\n\tfor (int line=0;line&lt;bottom+10;line++) {\n\n\t\tif ( (line % (dev._pages-1)) == 0) ssd1306_scroll_clear(&amp;dev);\n\t\tlineChar[0] = 0x02;\n\t\tsprintf(&amp;lineChar[1], \" Line %02d\", line);\n\t\tssd1306_scroll_text(&amp;dev, lineChar, strlen(lineChar), false);\n\t\tvTaskDelay(500 \/ portTICK_PERIOD_MS);\n\t}\n\tvTaskDelay(3000 \/ portTICK_PERIOD_MS);<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"311\" height=\"269\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-Page-Down.jpg?resize=311%2C269&#038;ssl=1\" alt=\"ESP32 OLED using ESP-IDF TextDemo project Page Down\" class=\"wp-image-879\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-Page-Down.jpg?w=311&amp;ssl=1 311w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-Page-Down.jpg?resize=300%2C259&amp;ssl=1 300w\" sizes=\"auto, (max-width: 311px) 100vw, 311px\" \/><\/figure>\n<\/div>\n\n\n<h4 class=\"wp-block-heading\">Horizontal and Vertical Scroll<\/h4>\n\n\n\n<p>Next up we scroll the text &#8220;Horizontal&#8221;, horizontally across the screen. This is accomplished through the following section of code. Like always, it starts by clearing the screen and setting the contrast value. Next it displays the text &#8220;Horizontal&#8221; in the center with a black background and white text (invert is false). Then we use the <strong>ssd1306_hardware_scroll()<\/strong> function to first scroll the text towards right (<strong>SCROLL_RIGHT<\/strong>) and then after a delay of 5 seconds scroll it towards left (<strong>SCROLL_LEFT<\/strong>) and then stop (<strong>SCROLL_STOP<\/strong>) after another 5 seconds. This function only takes in two parameters. The first parameter is the address of the SSD1306_t structure and the second parameter is the scroll type.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code class=\"\">\/\/ Horizontal Scroll\n\tssd1306_clear_screen(&amp;dev, false);\n\tssd1306_contrast(&amp;dev, 0xff);\n\tssd1306_display_text(&amp;dev, center, \"Horizontal\", 10, false);\n\tssd1306_hardware_scroll(&amp;dev, SCROLL_RIGHT);\n\tvTaskDelay(5000 \/ portTICK_PERIOD_MS);\n\tssd1306_hardware_scroll(&amp;dev, SCROLL_LEFT);\n\tvTaskDelay(5000 \/ portTICK_PERIOD_MS);\n\tssd1306_hardware_scroll(&amp;dev, SCROLL_STOP);<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"365\" height=\"270\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-Horizontal-Scroll.jpg?resize=365%2C270&#038;ssl=1\" alt=\"ESP32 OLED using ESP-IDF TextDemo project Horizontal Scroll\" class=\"wp-image-875\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-Horizontal-Scroll.jpg?w=365&amp;ssl=1 365w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-Horizontal-Scroll.jpg?resize=300%2C222&amp;ssl=1 300w\" sizes=\"auto, (max-width: 365px) 100vw, 365px\" \/><\/figure>\n<\/div>\n\n\n<p>Similarly, we will scroll the text &#8220;Vertical&#8221;, vertically across the screen. This is accomplished through the following section of code. Like always, it starts by clearing the screen and setting the contrast value. Next it displays the text &#8220;Vertical&#8221; in the center with a black background and white text (invert is false). Then we use the <strong>ssd1306_hardware_scroll()<\/strong> function to first scroll the text down (<strong>SCROLL_DOWN<\/strong>) and then after a delay of 5 seconds scroll it back up (<strong>SCROLL_UP<\/strong>) and then stop (SCROLL_STOP) after another 5 seconds. This function only takes in two parameters. The first parameter is the address of the SSD1306_t structure and the second parameter is the scroll type.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code class=\"\">\n\t\/\/ Vertical Scroll\n\tssd1306_clear_screen(&amp;dev, false);\n\tssd1306_contrast(&amp;dev, 0xff);\n\tssd1306_display_text(&amp;dev, center, \"Vertical\", 8, false);\n\tssd1306_hardware_scroll(&amp;dev, SCROLL_DOWN);\n\tvTaskDelay(5000 \/ portTICK_PERIOD_MS);\n\tssd1306_hardware_scroll(&amp;dev, SCROLL_UP);\n\tvTaskDelay(5000 \/ portTICK_PERIOD_MS);\n\tssd1306_hardware_scroll(&amp;dev, SCROLL_STOP);<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"346\" height=\"285\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-Vertical.jpg?resize=346%2C285&#038;ssl=1\" alt=\"ESP32 OLED using ESP-IDF TextDemo project Vertical\" class=\"wp-image-876\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-Vertical.jpg?w=346&amp;ssl=1 346w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-Vertical.jpg?resize=300%2C247&amp;ssl=1 300w\" sizes=\"auto, (max-width: 346px) 100vw, 346px\" \/><\/figure>\n<\/div>\n\n\n<p>Finally, after clearing the screen and setting the contrast, we will display the text &#8221; Good Bye!!&#8221; in the center. The background will be white and the color of the text will be black. This is because invert is set as true in this case.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code class=\"\">\/\/ Invert\n\tssd1306_clear_screen(&amp;dev, true);\n\tssd1306_contrast(&amp;dev, 0xff);\n\tssd1306_display_text(&amp;dev, center, \"  Good Bye!!\", 12, true);\n\tvTaskDelay(5000 \/ portTICK_PERIOD_MS);<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"281\" height=\"303\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-Display-Text-and-Invert-2.jpg?resize=281%2C303&#038;ssl=1\" alt=\"ESP32 OLED using ESP-IDF TextDemo project Display Text and Invert 2\" class=\"wp-image-880\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-Display-Text-and-Invert-2.jpg?w=281&amp;ssl=1 281w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-Display-Text-and-Invert-2.jpg?resize=278%2C300&amp;ssl=1 278w\" sizes=\"auto, (max-width: 281px) 100vw, 281px\" \/><\/figure>\n<\/div>\n\n\n<p>Then the screen slowly fades out and turns black. Shortly, the ESP32 board restarts again.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code class=\"\">ssd1306_fadeout(&amp;dev);\nesp_restart();<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Compiling the Sketch<\/h3>\n\n\n\n<p>To flash your chip, type the following command in the serial terminal. Remember to replace the COM port with the one through which your board is connected.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code class=\"\">idf.py -p COMX flash monitor<\/code><\/pre>\n\n\n\n<p>After the code flashes successfully, you can view the informational messages being printed showing the SSD1306 configuration parameters and its status.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"222\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-terminal.jpg?resize=1024%2C222&#038;ssl=1\" alt=\"ESP32 OLED using ESP-IDF TextDemo project terminal\" class=\"wp-image-882\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-terminal.jpg?resize=1024%2C222&amp;ssl=1 1024w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-terminal.jpg?resize=300%2C65&amp;ssl=1 300w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-terminal.jpg?resize=768%2C166&amp;ssl=1 768w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-terminal.jpg?w=1039&amp;ssl=1 1039w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>The OLED will start displaying all the different texts and scrolling features. Watch the video below to have a better insight.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"(Demo) OLED with ESP32 using ESP IDF Display and Scrolling text Example\" width=\"1200\" height=\"675\" src=\"https:\/\/www.youtube.com\/embed\/9v-5XzEFTvw?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-station-mode-vs-soft-ap-mode\">ESP32 OLED with ESP-IDF Display Animation<\/h2>\n\n\n\n<p>After showing you how the to use SSD1306 driver to display text and apply various scrolling effects, let&#8217;s include some output results for some more examples that use the SSD1306\/SH1106 Driver for ESP-IDF, provided by nopnop2002 on GitHub. We will demonstrate AnimationDemo by nopnop2002 uploaded on GitHub at the following link but use different image frames for demonstration.<\/p>\n\n\n\n<div class=\"wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-16018d1d wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button has-custom-width wp-block-button__width-25\"><a class=\"wp-block-button__link has-midnight-gradient-background has-background\" href=\"https:\/\/github.com\/nopnop2002\/esp-idf-ssd1306\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>DOWNLOAD<\/strong><\/a><\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Create Project<\/h3>\n\n\n\n<p>Open your VS Code and head over to&nbsp;<strong>View &gt; Command Palette<\/strong>. Type&nbsp;<strong>ESP-IDF: New Project<\/strong>&nbsp;in the search bar and press enter.<\/p>\n\n\n\n<p>Specify the project name and directory. We have named our project \u2018ESP_IDF_SSD1306_AnimationDemo.\u2019 For the ESP-IDF board, we have chosen the custom board option. For ESP-IDF target, we have chosen ESP32 module. Click \u2018Choose Template\u2019 button to proceed forward.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"632\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-Create-AnimationDemo-project.jpg?resize=1024%2C632&#038;ssl=1\" alt=\"ESP32 OLED using ESP-IDF Create AnimationDemo project\" class=\"wp-image-901\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-Create-AnimationDemo-project.jpg?resize=1024%2C632&amp;ssl=1 1024w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-Create-AnimationDemo-project.jpg?resize=300%2C185&amp;ssl=1 300w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-Create-AnimationDemo-project.jpg?resize=768%2C474&amp;ssl=1 768w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-Create-AnimationDemo-project.jpg?w=1241&amp;ssl=1 1241w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>In the Extension, select ESP-IDF option:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1347\" height=\"549\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-2.jpg?resize=1024%2C417&amp;ssl=1\" alt=\"ESP-IDF in VS Code New Project 2\" class=\"wp-image-78\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-2.jpg?w=1347&amp;ssl=1 1347w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-2.jpg?resize=300%2C122&amp;ssl=1 300w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-2.jpg?resize=1024%2C417&amp;ssl=1 1024w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-2.jpg?resize=768%2C313&amp;ssl=1 768w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p>We will click the \u2018sample_project\u2019 under the get-started tab. Now click \u2018Create project using template sample_project.\u2019<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1267\" height=\"748\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-3.jpg?resize=1024%2C605&amp;ssl=1\" alt=\"ESP-IDF in VS Code New Project 3\" class=\"wp-image-79\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-3.jpg?w=1267&amp;ssl=1 1267w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-3.jpg?resize=300%2C177&amp;ssl=1 300w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-3.jpg?resize=1024%2C605&amp;ssl=1 1024w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-3.jpg?resize=768%2C453&amp;ssl=1 768w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p>You will get a notification that the project has been created. To open the project in a new window, click \u2018Yes.\u2019<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Add Libraries<\/h3>\n\n\n\n<p>This opens project that we created, inside the EXPLORER tab. There are several folders inside our project folder. Create a new folder named &#8216;components&#8217; and copy the files from this destination into your project folder. This will contain the libraries that will be required for this project.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">SSD1306 Configuration<\/h3>\n\n\n\n<p>Let&#8217;s first head over to the <strong>menuconfig<\/strong>. Opens the ESP-IDF SDK Configuration Editor. Scroll down and open the <strong>SSD1306 Configuration<\/strong>. Here we can set the SSD1306 configuration parameter according to our needs. This includes the UART interface, panel type, SCL GPIO pin, SDA GPIO pin and the reset GPIO pin. Here you can view that by default, ESP-IDF is using the interface as I2C, panel type as 128&#215;64, SCL GPIO pin as 22, SDA GPIO pin as 21 and Reset GPIO pin as 33. You can alter these parameters according to your OLED display and then click the Save button found at the top. We will leave the configuration settings as default as they match our module.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"556\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-SDK-configuration-editor-1024x556.jpg?resize=1024%2C556&#038;ssl=1\" alt=\"ESP32 OLED using ESP-IDF TextDemo project SDK configuration editor\" class=\"wp-image-845\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-SDK-configuration-editor.jpg?resize=1024%2C556&amp;ssl=1 1024w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-SDK-configuration-editor.jpg?resize=300%2C163&amp;ssl=1 300w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-SDK-configuration-editor.jpg?resize=768%2C417&amp;ssl=1 768w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-SDK-configuration-editor.jpg?w=1333&amp;ssl=1 1333w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>Alternatively, we can also set this config value with menuconfig. Open menuconfig by typing <strong>idf.py menuconfig<\/strong> in the terminal. This command opens the Espressif IoT Development Framework Configuration. Head over to <strong>SSD1306 Configuration<\/strong> and set the parameters accordingly.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Code<\/h3>\n\n\n\n<p>Go to&nbsp;<strong>main &gt; main.c&nbsp;<\/strong>and open it. We will define the functions and the program code here. This is our <strong>main.c<\/strong> file.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code class=\"\">#include &lt;stdio.h&gt;\n#include &lt;stdlib.h&gt;\n#include &lt;string.h&gt;\n#include \"freertos\/FreeRTOS.h\"\n#include \"freertos\/task.h\"\n#include \"esp_log.h\"\n\n#include \"ssd1306.h\"\n#include \"font8x8_basic.h\"\n\n\/*\n You have to set this config value with menuconfig\n CONFIG_INTERFACE\n for i2c\n CONFIG_MODEL\n CONFIG_SDA_GPIO\n CONFIG_SCL_GPIO\n CONFIG_RESET_GPIO\n for SPI\n CONFIG_CS_GPIO\n CONFIG_DC_GPIO\n CONFIG_RESET_GPIO\n*\/\n\n#define TAG \"SSD1306\"\n\nconst unsigned char myBitmap[4] [1024] = {\n\n\t\/\/ 'frame1, 64x128px\n\n{\t0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xf8, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x03, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xf0, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x03, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xf0, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x3f, 0xff, 0xff, \n\t0xff, 0xff, 0xfe, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x3f, 0xff, 0xff, \n\t0xff, 0xff, 0xf8, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0xf8, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x01, 0xff, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x01, 0xff, 0x07, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x01, 0xff, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x01, 0xff, 0x07, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x7c, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0xf8, 0x00, 0x7c, 0x07, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x7c, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0xf8, 0x00, 0x7c, 0x07, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0xf8, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0xfe, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x3f, 0xff, 0xff, \n\t0xff, 0xff, 0xfe, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x3f, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0x00, 0x00, 0x3f, 0xfe, 0x3f, 0xff, 0xff, 0xff, 0xc0, 0x03, 0xff, 0xfc, 0x1f, \n\t0xff, 0xff, 0xff, 0xc0, 0x03, 0xff, 0xfc, 0x1f, 0xff, 0xff, 0xff, 0xc0, 0x03, 0xff, 0xfc, 0x1f, \n\t0xff, 0xff, 0xfe, 0x00, 0x00, 0x1f, 0xf0, 0x1f, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x1f, 0xf0, 0x1f, \n\t0xff, 0xff, 0xfe, 0x00, 0x00, 0x1f, 0xf0, 0x1f, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x1f, 0xf0, 0x1f, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x7f, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x7f, \n\t0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, \n\t0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x47, 0xf3, 0xff, \n\t0xff, 0x80, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, \n\t0xff, 0x80, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, \n\t0xf8, 0x00, 0x78, 0x00, 0x03, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x78, 0x00, 0x03, 0xff, 0xff, 0xff, \n\t0xf8, 0x00, 0x78, 0x00, 0x03, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x78, 0x00, 0x03, 0xff, 0xff, 0xff, \n\t0xf8, 0x0f, 0xf8, 0x00, 0x03, 0xff, 0xff, 0xff, 0xf8, 0x0f, 0xf8, 0x00, 0x03, 0xff, 0xff, 0xff, \n\t0xf8, 0x0f, 0xf8, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x03, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xf8, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x03, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xf8, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x03, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xf8, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x03, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xf8, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xf8, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xf8, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0xfe, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0xe2, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xfc, 0x00, 0xc0, 0x00, 0x01, 0xcf, 0xff, \n\t0xff, 0xfc, 0x00, 0xc0, 0x00, 0x01, 0xcf, 0xff, 0xff, 0xfc, 0x00, 0xc0, 0x00, 0x01, 0x8f, 0xff, \n\t0xff, 0xf0, 0x00, 0x00, 0x0f, 0xc0, 0x0f, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x0f, 0xc0, 0x0f, 0xff, \n\t0xff, 0xf0, 0x00, 0x00, 0x0f, 0xc0, 0x0f, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x0f, 0xc0, 0x0f, 0xff, \n\t0xff, 0xf3, 0xe0, 0x00, 0x3f, 0xe0, 0x3f, 0xff, 0xff, 0xf3, 0xe0, 0x00, 0x7f, 0xf8, 0x3f, 0xff, \n\t0xff, 0xf3, 0xe0, 0x00, 0x7f, 0xf8, 0x3f, 0xff, 0xff, 0xf3, 0xe0, 0x00, 0x7f, 0xf8, 0x3f, 0xff, \n\t0xff, 0xff, 0xf8, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x01, 0xff, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xf8, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x01, 0xff, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff\n}, \n\t\/\/ 'frame2, 64x128px\n\n{\t0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x7f, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xfe, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x7f, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xfe, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x03, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xc0, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x03, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xc0, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, \n\t0xff, 0xfe, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, \n\t0xff, 0xf8, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, \n\t0xff, 0xf8, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, \n\t0xff, 0xf8, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, \n\t0xff, 0xf8, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, \n\t0xff, 0xf8, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, \n\t0xff, 0xf8, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, \n\t0xff, 0xf8, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, \n\t0xff, 0xf8, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, \n\t0xff, 0xf8, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, \n\t0xff, 0xf8, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, \n\t0xff, 0xf8, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, \n\t0xff, 0xf8, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, \n\t0xff, 0xf8, 0x00, 0x3f, 0xe0, 0x7f, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x3f, 0xe0, 0x7f, 0xff, 0xff, \n\t0xff, 0xf8, 0x00, 0x3f, 0xe0, 0x7f, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x3f, 0xe0, 0x7f, 0xff, 0xff, \n\t0xff, 0xfe, 0x00, 0x0f, 0x80, 0x7f, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x0f, 0x80, 0x7f, 0xff, 0xff, \n\t0xff, 0xfe, 0x00, 0x0f, 0x80, 0x7f, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x0f, 0x80, 0x7f, 0xff, 0xff, \n\t0xff, 0xfe, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, \n\t0xff, 0xfe, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, \n\t0xff, 0xff, 0xc0, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x03, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xc0, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x03, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xf8, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x7f, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xf8, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x1f, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xc0, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x0f, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xc0, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, \n\t0xff, 0xf8, 0x00, 0x00, 0x03, 0xff, 0x07, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x03, 0xff, 0x07, 0xff, \n\t0xff, 0xf8, 0x00, 0x00, 0x03, 0xff, 0x07, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x78, 0x07, 0xff, \n\t0xff, 0xe0, 0x00, 0x00, 0x00, 0x78, 0x07, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x78, 0x07, 0xff, \n\t0xff, 0xe0, 0x00, 0x00, 0x00, 0x78, 0x07, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, \n\t0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, \n\t0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, \n\t0xe0, 0x06, 0x00, 0x00, 0x7c, 0x00, 0xff, 0xff, 0xe0, 0x06, 0x00, 0x00, 0x7c, 0x00, 0xff, 0xff, \n\t0xe0, 0x06, 0x00, 0x00, 0x7c, 0x00, 0xff, 0xff, 0x80, 0xfe, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, \n\t0x80, 0xfe, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0x80, 0xfe, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, \n\t0x80, 0xfe, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0x83, 0xfe, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, \n\t0x83, 0xfe, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0x83, 0xfe, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, \n\t0x83, 0xfe, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, \n\t0xff, 0xfe, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, \n\t0xff, 0xfe, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, \n\t0xff, 0xfe, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, \n\t0xff, 0xfe, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x0f, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xc0, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x0f, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xc0, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x03, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xf0, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x03, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xf0, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x01, 0x80, 0x67, 0xff, 0xff, \n\t0xff, 0xe0, 0x00, 0x01, 0x80, 0x67, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x01, 0x80, 0x67, 0xff, 0xff, \n\t0xff, 0x00, 0x00, 0x01, 0x80, 0x07, 0xff, 0xff, 0xff, 0x00, 0x00, 0x0f, 0xe0, 0x07, 0xff, 0xff, \n\t0xff, 0x00, 0x00, 0x0f, 0xe0, 0x07, 0xff, 0xff, 0xff, 0x00, 0x00, 0x0f, 0xe0, 0x07, 0xff, 0xff, \n\t0xff, 0x00, 0x00, 0x0f, 0xe0, 0x07, 0xff, 0xff, 0xff, 0x1e, 0x00, 0x3f, 0xfc, 0x1f, 0xff, 0xff, \n\t0xff, 0x1e, 0x00, 0x3f, 0xfc, 0x1f, 0xff, 0xff, 0xff, 0x1e, 0x00, 0x3f, 0xfc, 0x1f, 0xff, 0xff, \n\t0xff, 0x1e, 0x00, 0x3f, 0xfc, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff\n}, \n\t\/\/ 'frame3, 64x128px\n\n{\t0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x01, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xf8, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x01, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xf8, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x0f, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x0f, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x03, 0xff, 0xff, \n\t0xff, 0xff, 0xfc, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x03, 0xff, 0xff, \n\t0xff, 0xff, 0xfc, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x01, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x01, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x01, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x01, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x01, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x01, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x01, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x01, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x01, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x01, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x01, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x01, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x01, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0xff, 0xc1, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0xff, 0xc1, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0xff, 0xc1, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0xff, 0xc1, 0xff, 0xff, \n\t0xff, 0xff, 0xfc, 0x00, 0x3e, 0x01, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x3e, 0x01, 0xff, 0xff, \n\t0xff, 0xff, 0xfc, 0x00, 0x3e, 0x01, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x3e, 0x01, 0xff, 0xff, \n\t0xff, 0xff, 0xfc, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x01, 0xff, 0xff, \n\t0xff, 0xff, 0xfc, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x01, 0xff, 0xff, \n\t0xff, 0xff, 0xfc, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x0f, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x0f, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x01, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xe0, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x01, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0x80, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x3f, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x3f, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x3f, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x3f, 0xff, 0xff, \n\t0xff, 0xff, 0x80, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x3f, 0xff, 0xff, \n\t0xff, 0xff, 0x80, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x3f, 0xff, 0xff, \n\t0xff, 0xff, 0x80, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x3f, 0xff, 0xff, \n\t0xff, 0xff, 0x80, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x3f, 0xff, 0xff, \n\t0xff, 0xff, 0x80, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x0c, 0x0f, 0xff, \n\t0xff, 0xff, 0x80, 0x00, 0x00, 0x0c, 0x0f, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x0c, 0x0f, 0xff, \n\t0xff, 0xff, 0x80, 0x00, 0x00, 0x0c, 0x0f, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x0f, 0xff, \n\t0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x0f, 0xff, \n\t0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x01, 0x80, 0x7f, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x01, 0xc0, 0x7f, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x01, 0xc0, 0x7f, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x01, 0xc0, 0x7f, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x01, 0xc0, 0x7f, 0xff, \n\t0xff, 0xff, 0xfc, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x01, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xfc, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x01, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xfc, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x01, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xfc, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x3f, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x3f, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xc0, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xc0, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0x80, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0x80, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x01, 0xff, 0xff, \n\t0xff, 0xff, 0x80, 0x00, 0x10, 0x01, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x10, 0x01, 0xff, 0xff, \n\t0xff, 0xff, 0x80, 0x00, 0x10, 0x01, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x10, 0x01, 0x8f, 0xff, \n\t0xff, 0xff, 0x9f, 0xff, 0xfe, 0x01, 0x8f, 0xff, 0xff, 0xff, 0x9f, 0xff, 0xfe, 0x01, 0x8f, 0xff, \n\t0xff, 0xff, 0x9f, 0xff, 0xfe, 0x01, 0x8f, 0xff, 0xff, 0xff, 0x9f, 0xff, 0xfe, 0x01, 0x8f, 0xff, \n\t0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x0f, 0xff, \n\t0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x0f, 0xff, \n\t0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x7f, 0xff, \n\t0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x7f, 0xff\n}, \n\t\/\/ 'frame4, 64x128px\n\n{\t0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x3f, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xf8, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x3f, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xf8, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0xff, 0xff, \n\t0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0xff, 0xff, \n\t0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x1f, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x1f, 0xff, \n\t0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, \n\t0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, \n\t0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, \n\t0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, \n\t0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, \n\t0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, \n\t0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, \n\t0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, \n\t0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, \n\t0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, \n\t0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, \n\t0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, \n\t0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, \n\t0xff, 0xff, 0x00, 0x00, 0x7f, 0xf8, 0x1f, 0xff, 0xff, 0xff, 0x00, 0x00, 0x7f, 0xf8, 0x1f, 0xff, \n\t0xff, 0xff, 0x00, 0x00, 0x7f, 0xf8, 0x1f, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x0f, 0xc0, 0x1f, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x0f, 0xc0, 0x1f, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x0f, 0xc0, 0x1f, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x0f, 0xc0, 0x1f, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x1f, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x1f, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x1f, 0xff, \n\t0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0xff, 0xff, \n\t0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xc0, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x3f, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xc0, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0xfc, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0xfc, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x3f, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x3f, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x3f, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x3f, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x3f, 0xff, 0xff, \n\t0xff, 0xff, 0xfc, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x3f, 0xff, 0xff, \n\t0xff, 0xff, 0xfc, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x3f, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0x80, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x3f, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0x80, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x3f, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x3f, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x3f, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x01, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xe0, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe1, 0xf8, 0x0f, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xe1, 0xf8, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe1, 0xf8, 0x0f, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xe1, 0xf8, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x0f, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xf8, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x0f, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xf8, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x01, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xf8, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x01, 0xff, 0xff, 0xff, \n\t0xff, 0xff, 0xff, 0xf8, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x01, 0xff, 0xff, 0xff\n}\n};\n\n\nvoid app_main(void)\n{\n\tSSD1306_t dev;\n\n#if CONFIG_I2C_INTERFACE\n\tESP_LOGI(TAG, \"INTERFACE is i2c\");\n\tESP_LOGI(TAG, \"CONFIG_SDA_GPIO=%d\",CONFIG_SDA_GPIO);\n\tESP_LOGI(TAG, \"CONFIG_SCL_GPIO=%d\",CONFIG_SCL_GPIO);\n\tESP_LOGI(TAG, \"CONFIG_RESET_GPIO=%d\",CONFIG_RESET_GPIO);\n\ti2c_master_init(&amp;dev, CONFIG_SDA_GPIO, CONFIG_SCL_GPIO, CONFIG_RESET_GPIO);\n#endif \/\/ CONFIG_I2C_INTERFACE\n\n#if CONFIG_SPI_INTERFACE\n\tESP_LOGI(TAG, \"INTERFACE is SPI\");\n\tESP_LOGI(TAG, \"CONFIG_MOSI_GPIO=%d\",CONFIG_MOSI_GPIO);\n\tESP_LOGI(TAG, \"CONFIG_SCLK_GPIO=%d\",CONFIG_SCLK_GPIO);\n\tESP_LOGI(TAG, \"CONFIG_CS_GPIO=%d\",CONFIG_CS_GPIO);\n\tESP_LOGI(TAG, \"CONFIG_DC_GPIO=%d\",CONFIG_DC_GPIO);\n\tESP_LOGI(TAG, \"CONFIG_RESET_GPIO=%d\",CONFIG_RESET_GPIO);\n\tspi_master_init(&amp;dev, CONFIG_MOSI_GPIO, CONFIG_SCLK_GPIO, CONFIG_CS_GPIO, CONFIG_DC_GPIO, CONFIG_RESET_GPIO);\n#endif \/\/ CONFIG_SPI_INTERFACE\n\n\n#if CONFIG_SSD1306_128x64\n\tESP_LOGI(TAG, \"Panel is 128x64\");\n\tssd1306_init(&amp;dev, 128, 64);\n#endif \/\/ CONFIG_SSD1306_128x64\n#if CONFIG_SSD1306_128x32\n\tESP_LOGE(TAG, \"Panel is 128x32. This demo cannot be run.\");\n\twhile(1) { vTaskDelay(1); }\n#endif \/\/ CONFIG_SSD1306_128x32\n\n\tssd1306_contrast(&amp;dev, 0xff);\n\tssd1306_clear_screen(&amp;dev, false);\n\tint count = 3;\n\tuint8_t segs[128];\n\twhile(1) {\n\t\tTickType_t startTick = xTaskGetTickCount();\n\t\t\/\/ 1Ticks required\n\t\tfor (int page=0;page&lt;8;page++) {\n\t\t\tfor (int seg=0;seg&lt;128;seg++) {\n\t\t\t\tsegs[seg] =  ssd1306_rotate_byte(myBitmap[count][seg*8+page]);\n\t\t\t}\n\t\t\tssd1306_display_image(&amp;dev, page, 0, segs, 128);\n\t\t}\n\n\t\tTickType_t endTick = xTaskGetTickCount();\n\t\tESP_LOGD(TAG, \"diffTick=%d\", endTick - startTick);\n\t\tcount--;\n\t\tif (count&lt;0) count = 3;\n\t\tvTaskDelay(10);\n\t}\n\tvTaskDelay(2000 \/ portTICK_PERIOD_MS);\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Compiling the Sketch<\/h3>\n\n\n\n<p>To flash your chip, type the following command in the serial terminal. Remember to replace the COM port with the one through which your board is connected.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code class=\"\">idf.py -p COMX flash monitor<\/code><\/pre>\n\n\n\n<p>After the code flashes successfully, you can view the informational messages being printed showing the SSD1306 configuration parameters and its status.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"323\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-AnimationDemo-project-terminal.jpg?resize=1024%2C323&#038;ssl=1\" alt=\"ESP32 OLED using ESP-IDF AnimationDemo project terminal\" class=\"wp-image-892\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-AnimationDemo-project-terminal.jpg?resize=1024%2C323&amp;ssl=1 1024w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-AnimationDemo-project-terminal.jpg?resize=300%2C95&amp;ssl=1 300w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-AnimationDemo-project-terminal.jpg?resize=768%2C242&amp;ssl=1 768w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-AnimationDemo-project-terminal.jpg?w=1031&amp;ssl=1 1031w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>The OLED will start displaying the moving animation. Watch the video below to have a better insight.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"(Demo) ESP32 OLED with ESP IDF Display Animation\" width=\"1200\" height=\"675\" src=\"https:\/\/www.youtube.com\/embed\/29zkYTzgzcw?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-station-mode-vs-soft-ap-mode\">Display Counter value on OLED with ESP32 and ESP-IDF<\/h2>\n\n\n\n<p>In this section, we will demonstrate CounterDemo by nopnop2002 uploaded on GitHub at the following link: <\/p>\n\n\n\n<div class=\"wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-16018d1d wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button has-custom-width wp-block-button__width-25\"><a class=\"wp-block-button__link has-midnight-gradient-background has-background\" href=\"https:\/\/github.com\/nopnop2002\/esp-idf-ssd1306\/tree\/master\/CounterDemo\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>DOWNLOAD<\/strong><\/a><\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Create Project<\/h3>\n\n\n\n<p>Open your VS Code and head over to&nbsp;<strong>View &gt; Command Palette<\/strong>. Type&nbsp;<strong>ESP-IDF: New Project<\/strong>&nbsp;in the search bar and press enter.<\/p>\n\n\n\n<p>Specify the project name and directory. We have named our project \u2018ESP_IDF_SSD1306_CounterDemo.\u2019 For the ESP-IDF board, we have chosen the custom board option. For ESP-IDF target, we have chosen ESP32 module. Click \u2018Choose Template\u2019 button to proceed forward.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"641\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-Create-CounterDemo-project.jpg?resize=1024%2C641&#038;ssl=1\" alt=\"ESP32 OLED using ESP-IDF Create CounterDemo project\" class=\"wp-image-902\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-Create-CounterDemo-project.jpg?resize=1024%2C641&amp;ssl=1 1024w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-Create-CounterDemo-project.jpg?resize=300%2C188&amp;ssl=1 300w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-Create-CounterDemo-project.jpg?resize=768%2C481&amp;ssl=1 768w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-Create-CounterDemo-project.jpg?w=1201&amp;ssl=1 1201w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>In the Extension, select ESP-IDF option:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1347\" height=\"549\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-2.jpg?resize=1024%2C417&amp;ssl=1\" alt=\"ESP-IDF in VS Code New Project 2\" class=\"wp-image-78\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-2.jpg?w=1347&amp;ssl=1 1347w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-2.jpg?resize=300%2C122&amp;ssl=1 300w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-2.jpg?resize=1024%2C417&amp;ssl=1 1024w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-2.jpg?resize=768%2C313&amp;ssl=1 768w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p>We will click the \u2018sample_project\u2019 under the get-started tab. Now click \u2018Create project using template sample_project.\u2019<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1267\" height=\"748\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-3.jpg?resize=1024%2C605&amp;ssl=1\" alt=\"ESP-IDF in VS Code New Project 3\" class=\"wp-image-79\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-3.jpg?w=1267&amp;ssl=1 1267w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-3.jpg?resize=300%2C177&amp;ssl=1 300w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-3.jpg?resize=1024%2C605&amp;ssl=1 1024w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-3.jpg?resize=768%2C453&amp;ssl=1 768w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p>You will get a notification that the project has been created. To open the project in a new window, click \u2018Yes.\u2019<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Add Libraries<\/h3>\n\n\n\n<p>This opens project that we created, inside the EXPLORER tab. There are several folders inside our project folder. Create a new folder named &#8216;<strong>components<\/strong>&#8216; and copy the <a href=\"https:\/\/github.com\/nopnop2002\/esp-idf-ssd1306\/tree\/master\/components\/ssd1306\" target=\"_blank\" rel=\"noopener\">files from this destination <\/a>into your project folder. This will contain the libraries that will be required for this project.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">SSD1306 Configuration<\/h3>\n\n\n\n<p>Let&#8217;s first head over to the <strong>menuconfig<\/strong>. Opens the ESP-IDF SDK Configuration Editor. Scroll down and open the <strong>SSD1306 Configuration<\/strong>. Here we can set the SSD1306 configuration parameter according to our needs. This includes the UART interface, panel type, SCL GPIO pin, SDA GPIO pin, and the reset GPIO pin. Here you can view that by default, ESP-IDF is using the interface as I2C, panel type as 128&#215;64, SCL GPIO pin as 22, SDA GPIO pin as 21 and Reset GPIO pin as 33. You can alter these parameters according to your OLED display and then click the Save button found at the top. We will leave the configuration settings as default as they match our module.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"556\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-SDK-configuration-editor-1024x556.jpg?resize=1024%2C556&#038;ssl=1\" alt=\"ESP32 OLED using ESP-IDF TextDemo project SDK configuration editor\" class=\"wp-image-845\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-SDK-configuration-editor.jpg?resize=1024%2C556&amp;ssl=1 1024w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-SDK-configuration-editor.jpg?resize=300%2C163&amp;ssl=1 300w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-SDK-configuration-editor.jpg?resize=768%2C417&amp;ssl=1 768w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-SDK-configuration-editor.jpg?w=1333&amp;ssl=1 1333w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>Alternatively, we can also set this config value with menuconfig. Open menuconfig by typing <strong>idf.py menuconfig<\/strong> in the terminal. This command opens the Espressif IoT Development Framework Configuration. Head over to <strong>SSD1306 Configuration<\/strong> and set the parameters accordingly.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Code<\/h3>\n\n\n\n<p>Go to&nbsp;<strong>main &gt; main.c&nbsp;<\/strong>and open it. We will define the functions and the program code here. Copy the code from <a href=\"https:\/\/github.com\/nopnop2002\/esp-idf-ssd1306\/blob\/master\/CounterDemo\/main\/main.c\">this link<\/a> here.<\/p>\n\n\n\n<p>This is our <strong>main.c<\/strong> file.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code class=\"\">#include &lt;stdio.h&gt;\n#include &lt;stdlib.h&gt;\n#include &lt;string.h&gt;\n#include \"freertos\/FreeRTOS.h\"\n#include \"freertos\/task.h\"\n#include \"esp_log.h\"\n\n#include \"ssd1306.h\"\n#include \"font8x8_basic.h\"\n\n\/*\n You have to set this config value with menuconfig\n CONFIG_INTERFACE\n for i2c\n CONFIG_MODEL\n CONFIG_SDA_GPIO\n CONFIG_SCL_GPIO\n CONFIG_RESET_GPIO\n for SPI\n CONFIG_CS_GPIO\n CONFIG_DC_GPIO\n CONFIG_RESET_GPIO\n*\/\n\n#define TAG \"SSD1306\"\n\n#define IMAGES 10\n\nuint8_t segmentDisplay[IMAGES][192] = {\n{\n\/\/ https:\/\/www.iconspng.com\/image\/5656\/seven-segment-display-gray-0\n\/\/ 'seven-segment-display-gray-0', 32x48px\n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xe0, 0x07, 0xff, 0xff, 0xe0, 0x06, 0xff, 0xff, 0x60, \n0x07, 0x7f, 0xfe, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, \n0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, \n0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, \n0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x02, 0x00, 0x00, 0x40, \n0x02, 0x00, 0x00, 0x40, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, \n0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, \n0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, \n0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0xff, 0xff, 0xe0, \n0x07, 0xff, 0xff, 0xe0, 0x07, 0xff, 0xff, 0xe0, 0x07, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\n},\n{\n\/\/ https:\/\/www.iconspng.com\/image\/5657\/seven-segment-display-gray-1\n\/\/ 'seven-segment-display-gray-1', 32x48px\n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x60, \n0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x40, \n0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x00, 0xe0, \n0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\n},\n{\n\/\/ https:\/\/www.iconspng.com\/image\/5658\/seven-segment-display-gray-2\n\/\/ 'seven-segment-display-gray-2', 32x48px\n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xe0, 0x03, 0xff, 0xff, 0xe0, 0x01, 0xff, 0xff, 0x60, \n0x00, 0xff, 0xfe, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x7f, 0xfe, 0xe0, 0x01, 0xff, 0xff, 0xc0, \n0x03, 0xff, 0xff, 0x00, 0x07, 0x7f, 0xfe, 0x00, 0x07, 0x80, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, \n0x07, 0x80, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, \n0x07, 0x80, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, \n0x07, 0x80, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x07, 0xff, 0xff, 0x00, \n0x07, 0xff, 0xff, 0x80, 0x07, 0xff, 0xff, 0xc0, 0x07, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\n},\n{\n\/\/ https:\/\/www.iconspng.com\/image\/5659\/seven-segment-display-gray-3\n\/\/ 'seven-segment-display-gray-3', 32x48px\n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xe0, 0x03, 0xff, 0xff, 0xe0, 0x01, 0xff, 0xff, 0x60, \n0x00, 0xff, 0xfe, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x7f, 0xfe, 0xe0, 0x01, 0xff, 0xff, 0x80, \n0x01, 0xff, 0xff, 0x40, 0x00, 0x7f, 0xfe, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0xff, 0xff, 0xe0, \n0x01, 0xff, 0xff, 0xe0, 0x03, 0xff, 0xff, 0xe0, 0x07, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\n},\n{\n\/\/ https:\/\/www.iconspng.com\/image\/5660\/seven-segment-display-gray-4\n\/\/ 'seven-segment-display-gray-4', 32x48px\n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x20, 0x06, 0x00, 0x00, 0x60, \n0x07, 0x00, 0x00, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, \n0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, \n0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, \n0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x7f, 0xfe, 0xe0, 0x03, 0xff, 0xff, 0x80, \n0x00, 0xff, 0xff, 0x40, 0x00, 0x7f, 0xfe, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x00, 0xe0, \n0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\n},\n{\n\/\/ https:\/\/www.iconspng.com\/image\/5661\/seven-segment-display-gray-5\n\/\/ 'seven-segment-display-gray-5', 32x48px\n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xe0, 0x07, 0xff, 0xff, 0xc0, 0x06, 0xff, 0xff, 0x80, \n0x07, 0x7f, 0xff, 0x00, 0x07, 0x80, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, \n0x07, 0x80, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, \n0x07, 0x80, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, \n0x07, 0x80, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x07, 0x7f, 0xfe, 0x00, 0x03, 0xff, 0xff, 0x80, \n0x00, 0xff, 0xff, 0xc0, 0x00, 0x7f, 0xfe, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0xff, 0xff, 0xe0, \n0x01, 0xff, 0xff, 0xe0, 0x03, 0xff, 0xff, 0xe0, 0x07, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\n},\n{\n\/\/ https:\/\/www.iconspng.com\/image\/5662\/seven-segment-display-gray-6\n\/\/ 'seven-segment-display-gray-6', 32x48px\n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xe0, 0x07, 0xff, 0xff, 0xc0, 0x06, 0xff, 0xff, 0x80, \n0x07, 0x7f, 0xff, 0x00, 0x07, 0x80, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, \n0x07, 0x80, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, \n0x07, 0x80, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, \n0x07, 0x80, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x07, 0x7f, 0xfe, 0x00, 0x01, 0xff, 0xff, 0x80, \n0x02, 0xff, 0xff, 0xc0, 0x07, 0x7f, 0xfe, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, \n0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, \n0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, \n0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0xff, 0xff, 0xe0, \n0x07, 0xff, 0xff, 0xe0, 0x07, 0xff, 0xff, 0xe0, 0x07, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\n},\n{\n\/\/ https:\/\/www.iconspng.com\/image\/5663\/seven-segment-display\n\/\/ 'seven-segment-display-gray-7', 32x48px\n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xe0, 0x03, 0xff, 0xff, 0xe0, 0x01, 0xff, 0xff, 0x60, \n0x00, 0xff, 0xfe, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x40, \n0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x00, 0xe0, \n0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\n},\n{\n\/\/ https:\/\/www.iconspng.com\/image\/5664\/seven-segment-display-gray-8\n\/\/ 'seven-segment-display-gray-8', 32x48px\n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xe0, 0x07, 0xff, 0xff, 0xe0, 0x06, 0xff, 0xff, 0x60, \n0x07, 0x7f, 0xfe, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, \n0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, \n0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, \n0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x7f, 0xfe, 0xe0, 0x01, 0xff, 0xff, 0x80, \n0x02, 0xff, 0xff, 0x40, 0x07, 0x7f, 0xfe, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, \n0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, \n0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, \n0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0xff, 0xff, 0xe0, \n0x07, 0xff, 0xff, 0xe0, 0x07, 0xff, 0xff, 0xe0, 0x07, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\n},\n{\n\/\/ https:\/\/www.iconspng.com\/image\/5665\/seven-segment-display\n\/\/ 'seven-segment-display-gray-9', 32x48px\n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xe0, 0x07, 0xff, 0xff, 0xe0, 0x06, 0xff, 0xff, 0x60, \n0x07, 0x7f, 0xfe, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, \n0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, \n0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, \n0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, 0x07, 0x7f, 0xfe, 0xe0, 0x03, 0xff, 0xff, 0x80, \n0x00, 0xff, 0xff, 0x40, 0x00, 0x7f, 0xfe, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0xff, 0xff, 0xe0, \n0x01, 0xff, 0xff, 0xe0, 0x03, 0xff, 0xff, 0xe0, 0x07, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\n}\n};\n\n\nvoid app_main(void)\n{\n\tSSD1306_t dev;\n\n#if CONFIG_I2C_INTERFACE\n\tESP_LOGI(TAG, \"INTERFACE is i2c\");\n\tESP_LOGI(TAG, \"CONFIG_SDA_GPIO=%d\",CONFIG_SDA_GPIO);\n\tESP_LOGI(TAG, \"CONFIG_SCL_GPIO=%d\",CONFIG_SCL_GPIO);\n\tESP_LOGI(TAG, \"CONFIG_RESET_GPIO=%d\",CONFIG_RESET_GPIO);\n\ti2c_master_init(&amp;dev, CONFIG_SDA_GPIO, CONFIG_SCL_GPIO, CONFIG_RESET_GPIO);\n#endif \/\/ CONFIG_I2C_INTERFACE\n\n#if CONFIG_SPI_INTERFACE\n\tESP_LOGI(TAG, \"INTERFACE is SPI\");\n\tESP_LOGI(TAG, \"CONFIG_MOSI_GPIO=%d\",CONFIG_MOSI_GPIO);\n\tESP_LOGI(TAG, \"CONFIG_SCLK_GPIO=%d\",CONFIG_SCLK_GPIO);\n\tESP_LOGI(TAG, \"CONFIG_CS_GPIO=%d\",CONFIG_CS_GPIO);\n\tESP_LOGI(TAG, \"CONFIG_DC_GPIO=%d\",CONFIG_DC_GPIO);\n\tESP_LOGI(TAG, \"CONFIG_RESET_GPIO=%d\",CONFIG_RESET_GPIO);\n\tspi_master_init(&amp;dev, CONFIG_MOSI_GPIO, CONFIG_SCLK_GPIO, CONFIG_CS_GPIO, CONFIG_DC_GPIO, CONFIG_RESET_GPIO);\n#endif \/\/ CONFIG_SPI_INTERFACE\n\n#if CONFIG_FLIP\n\tdev._flip = true;\n\tESP_LOGW(TAG, \"Flip upside down\");\n#endif\n\n#if CONFIG_SSD1306_128x64\n\tESP_LOGI(TAG, \"Panel is 128x64\");\n\tssd1306_init(&amp;dev, 128, 64);\n#endif \/\/ CONFIG_SSD1306_128x64\n#if CONFIG_SSD1306_128x32\n\tESP_LOGE(TAG, \"Panel is 128x32. This demo cannot be run.\");\n\twhile(1) { vTaskDelay(1); }\n#endif \/\/ CONFIG_SSD1306_128x32\n\tssd1306_contrast(&amp;dev, 0xff);\n\n\t\/\/ Allocate memory\n\tuint8_t *buffer = (uint8_t *)malloc(8*128); \/\/ 8 page 128 pixel\n\tif (buffer == NULL) {\n\t\tESP_LOGE(TAG, \"malloc failed\");\n\t\twhile(1) { vTaskDelay(1); }\n\t}\n\tuint8_t *segmentImage = (uint8_t *)malloc(IMAGES*8*32); \/\/ 10 image 8 page 32pixel\n\tif (segmentImage == NULL) {\n\t\tESP_LOGE(TAG, \"malloc failed\");\n\t\twhile(1) { vTaskDelay(1); }\n\t}\n\n\t\/\/ Convert from segmentDisplay to segmentImage\n\tfor (int imageIndex=0;imageIndex&lt;IMAGES;imageIndex++) {\n\t\tssd1306_clear_screen(&amp;dev, false);\n\t\tssd1306_bitmaps(&amp;dev, 0, 8, segmentDisplay[imageIndex], 32, 48, false);\n\t\tvTaskDelay(200 \/ portTICK_PERIOD_MS);\n\n\t\t\/\/ Get from internal buffer to local buffer\n\t\t\/\/ buffer is [8][128] 8 page 128 pixel\n\t\tssd1306_get_buffer(&amp;dev, buffer);\n\n\t\t\/\/ Save from buffer to segmentImage\n\t\t\/\/ segmentImage is [10][8][32] 10 image 8 page 32 pixel\n\t\tint segmentImageIndex = imageIndex * 256;\n\t\tfor (int page=0;page&lt;8;page++) {\n\t\t\t\/\/ESP_LOGI(TAG, \"segmentImageIndex+page*32=%d\", segmentImageIndex+page*32);\n\t\t\tmemcpy(&amp;segmentImage[segmentImageIndex+page*32], &amp;buffer[page*128], 32);\n\t\t\t\/\/ESP_LOGI(TAG, \"page=%d\", page);\n\t\t\t\/\/ESP_LOG_BUFFER_HEXDUMP(TAG, &amp;buffer[page*128], 32, ESP_LOG_INFO);\n\t\t}\n\n#if 0\n\t\tssd1306_clear_screen(&amp;dev, false);\n\t\tfor (int page=0;page&lt;8;page++) {\n\t\t\tssd1306_display_image(&amp;dev, page, 0, &amp;segmentImage[segmentImageIndex+page*32], 32);\n\t\t\t\/\/ESP_LOGI(TAG, \"page=%d\", page);\n\t\t\t\/\/ESP_LOG_BUFFER_HEXDUMP(TAG, &amp;segmentImage[segmentImageIndex+page*32], 32, ESP_LOG_INFO);\n\t\t}\n\t\tvTaskDelay(1000 \/ portTICK_PERIOD_MS);\n#endif\n\t}\n\n\t\/\/ I don't use this anymore\n\tfree(buffer);\n\n\tint digit1 = 0;\n\tint digit2 = 0;\n\tint digit3 = 0;\n\tint digit4 = 0;\n\tssd1306_clear_screen(&amp;dev, false);\n\tfor (int page=0;page&lt;8;page++) {\n\t\tssd1306_display_image(&amp;dev, page, 0, &amp;segmentImage[page*32], 32);\n\t\tssd1306_display_image(&amp;dev, page, 32, &amp;segmentImage[page*32], 32);\n\t\tssd1306_display_image(&amp;dev, page, 64, &amp;segmentImage[page*32], 32);\n\t\tssd1306_display_image(&amp;dev, page, 96, &amp;segmentImage[page*32], 32);\n\t\tvTaskDelay(2);\n\t}\n\n\twhile(1) {\n\t\tdigit4++;\n\t\tif (digit4 == 10) {\n\t\t\tdigit4 = 0;\n\t\t\tint segmentImageIndex4 = digit4 * 256;\n\t\t\tfor (int page=0;page&lt;8;page++) {\n\t\t\t\tssd1306_display_image(&amp;dev, page, 96, &amp;segmentImage[segmentImageIndex4+page*32], 32);\n\t\t\t}\n\t\t\tdigit3++;\n\t\t\tif (digit3 == 10) {\n\t\t\t\tdigit3 = 0;\n\t\t\t\tdigit2++;\n\t\t\t\tif (digit2 == 10) {\n\t\t\t\t\tdigit2 = 0;\n\t\t\t\t\tdigit1++;\n\t\t\t\t\tif (digit1 == 10) {\n\t\t\t\t\t\tdigit1 = 0;\n\t\t\t\t\t\tdigit2 = 0;\n\t\t\t\t\t\tdigit3 = 0;\n\t\t\t\t\t\tdigit4 = 0;\n\t\t\t\t\t}\n\t\t\t\t\t\/\/ Update digit1\n\t\t\t\t\tint segmentImageIndex1 = digit1 * 256;\n\t\t\t\t\tfor (int page=0;page&lt;8;page++) {\n\t\t\t\t\t\tssd1306_display_image(&amp;dev, page, 00, &amp;segmentImage[segmentImageIndex1+page*32], 32);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\/\/ Update digit2\n\t\t\t\tint segmentImageIndex2 = digit2 * 256;\n\t\t\t\tfor (int page=0;page&lt;8;page++) {\n\t\t\t\t\tssd1306_display_image(&amp;dev, page, 32, &amp;segmentImage[segmentImageIndex2+page*32], 32);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\/\/ Update digit3\n\t\t\tint segmentImageIndex3 = digit3 * 256;\n\t\t\tfor (int page=0;page&lt;8;page++) {\n\t\t\t\tssd1306_display_image(&amp;dev, page, 64, &amp;segmentImage[segmentImageIndex3+page*32], 32);\n\t\t\t}\n\t\t} else {\t\n\t\t\t\/\/ Update digit4\n\t\t\tint segmentImageIndex4 = digit4 * 256;\n\t\t\tfor (int page=0;page&lt;8;page++) {\n\t\t\t\tssd1306_display_image(&amp;dev, page, 96, &amp;segmentImage[segmentImageIndex4+page*32], 32);\n\t\t\t}\n\t\t}\n\t\tvTaskDelay(8);\n\t} \/\/ end while\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Compiling the Sketch<\/h3>\n\n\n\n<p>To flash your chip, type the following command in the serial terminal. Remember to replace the COM port with the one through which your board is connected.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code class=\"\">idf.py -p COMX flash monitor<\/code><\/pre>\n\n\n\n<p>After the code flashes successfully, you can view the informational messages being printed showing the SSD1306 configuration parameters and its status.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"324\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-CounterDemo-project-terminal.jpg?resize=1024%2C324&#038;ssl=1\" alt=\"ESP32 OLED using ESP-IDF CounterDemo project terminal\" class=\"wp-image-896\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-CounterDemo-project-terminal.jpg?resize=1024%2C324&amp;ssl=1 1024w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-CounterDemo-project-terminal.jpg?resize=300%2C95&amp;ssl=1 300w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-CounterDemo-project-terminal.jpg?resize=768%2C243&amp;ssl=1 768w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-CounterDemo-project-terminal.jpg?w=1032&amp;ssl=1 1032w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>The OLED will start displaying the counter. Watch the video below to have a better insight.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"(Demo) ESP32 OLED with ESP IDF Display Counter Values\" width=\"1200\" height=\"675\" src=\"https:\/\/www.youtube.com\/embed\/hOe5BCEUkpk?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-station-mode-vs-soft-ap-mode\">ESP32 OLED with ESP-IDF Display Image<\/h2>\n\n\n\n<p>In this section, we will use ImageDemo by nopnop2002 uploaded on GitHub at the following link but use different images to demonstrate.<\/p>\n\n\n\n<div class=\"wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-16018d1d wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button has-custom-width wp-block-button__width-25\"><a class=\"wp-block-button__link has-midnight-gradient-background has-background\" href=\"https:\/\/github.com\/nopnop2002\/esp-idf-ssd1306\/tree\/master\/ImageDemo\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>DOWNLOAD<\/strong><\/a><\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Create Project<\/h3>\n\n\n\n<p>Open your VS Code and head over to&nbsp;<strong>View &gt; Command Palette<\/strong>. Type&nbsp;<strong>ESP-IDF: New Project<\/strong>&nbsp;in the search bar and press enter.<\/p>\n\n\n\n<p>Specify the project name and directory. We have named our project \u2018ESP_IDF_SSD1306_ImageDemo.\u2019 For the ESP-IDF board, we have chosen the custom board option. For ESP-IDF target, we have chosen ESP32 module. Click \u2018Choose Template\u2019 button to proceed forward.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"635\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-Create-ImageDemo-project.jpg?resize=1024%2C635&#038;ssl=1\" alt=\"ESP32 OLED using ESP-IDF Create ImageDemo project\" class=\"wp-image-903\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-Create-ImageDemo-project.jpg?resize=1024%2C635&amp;ssl=1 1024w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-Create-ImageDemo-project.jpg?resize=300%2C186&amp;ssl=1 300w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-Create-ImageDemo-project.jpg?resize=768%2C476&amp;ssl=1 768w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-Create-ImageDemo-project.jpg?w=1227&amp;ssl=1 1227w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>In the Extension, select ESP-IDF option:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1347\" height=\"549\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-2.jpg?resize=1024%2C417&amp;ssl=1\" alt=\"ESP-IDF in VS Code New Project 2\" class=\"wp-image-78\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-2.jpg?w=1347&amp;ssl=1 1347w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-2.jpg?resize=300%2C122&amp;ssl=1 300w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-2.jpg?resize=1024%2C417&amp;ssl=1 1024w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-2.jpg?resize=768%2C313&amp;ssl=1 768w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p>We will click the \u2018sample_project\u2019 under the get-started tab. Now click \u2018Create project using template sample_project.\u2019<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1267\" height=\"748\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-3.jpg?resize=1024%2C605&amp;ssl=1\" alt=\"ESP-IDF in VS Code New Project 3\" class=\"wp-image-79\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-3.jpg?w=1267&amp;ssl=1 1267w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-3.jpg?resize=300%2C177&amp;ssl=1 300w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-3.jpg?resize=1024%2C605&amp;ssl=1 1024w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-3.jpg?resize=768%2C453&amp;ssl=1 768w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p>You will get a notification that the project has been created. To open the project in a new window, click \u2018Yes.\u2019<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Add Libraries<\/h3>\n\n\n\n<p>This opens project that we created, inside the EXPLORER tab. There are several folders inside our project folder. Create a new folder named &#8216;<strong>components<\/strong>&#8216; and copy the <a href=\"https:\/\/github.com\/nopnop2002\/esp-idf-ssd1306\/tree\/master\/components\/ssd1306\" target=\"_blank\" rel=\"noopener\">files from this destination <\/a>in your project folder. This will contain the libraries that will be required for this project.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">SSD1306 Configuration<\/h3>\n\n\n\n<p>Let&#8217;s first head over to the <strong>menuconfig<\/strong>. Opens the ESP-IDF SDK Configuration Editor. Scroll down and open the <strong>SSD1306 Configuration<\/strong>. Here we can set the SSD1306 configuration parameter according to our needs. This includes the UART interface, panel type, SCL GPIO pin, SDA GPIO pin and the reset GPIO pin. Here you can view that by default, ESP-IDF is using the interface as I2C, panel type as 128&#215;64, SCL GPIO pin as 22, SDA GPIO pin as 21 and Reset GPIO pin as 33. You can alter these parameters according to your OLED display and then click the Save button found at the top. We will leave the configuration settings as default as they match our module.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"556\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-SDK-configuration-editor-1024x556.jpg?resize=1024%2C556&#038;ssl=1\" alt=\"ESP32 OLED using ESP-IDF TextDemo project SDK configuration editor\" class=\"wp-image-845\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-SDK-configuration-editor.jpg?resize=1024%2C556&amp;ssl=1 1024w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-SDK-configuration-editor.jpg?resize=300%2C163&amp;ssl=1 300w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-SDK-configuration-editor.jpg?resize=768%2C417&amp;ssl=1 768w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-SDK-configuration-editor.jpg?w=1333&amp;ssl=1 1333w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>Alternatively, we can also set this config value with menuconfig. Open menuconfig by typing <strong>idf.py menuconfig<\/strong> in the terminal. This command opens the Espressif IoT Development Framework Configuration. Head over to <strong>SSD1306 Configuration<\/strong> and set the parameters accordingly.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Code<\/h3>\n\n\n\n<p>Go to&nbsp;<strong>main &gt; main.c&nbsp;<\/strong>and open it. We will define the functions and the program code here. This is our <strong>main.c<\/strong> file.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code class=\"\">#include &lt;stdio.h&gt;\n#include &lt;stdlib.h&gt;\n#include &lt;string.h&gt;\n#include \"freertos\/FreeRTOS.h\"\n#include \"freertos\/task.h\"\n#include \"esp_log.h\"\n\n#include \"ssd1306.h\"\n#include \"font8x8_basic.h\"\n\n\/*\n You have to set this config value with menuconfig\n CONFIG_INTERFACE\n for i2c\n CONFIG_MODEL\n CONFIG_SDA_GPIO\n CONFIG_SCL_GPIO\n CONFIG_RESET_GPIO\n for SPI\n CONFIG_CS_GPIO\n CONFIG_DC_GPIO\n CONFIG_RESET_GPIO\n*\/\n\n#define TAG \"SSD1306\"\n\nuint8_t image1[] = {\n\/\/ 'image1', 32x13px\n0xfc, 0x00, 0x00, 0x3f, 0xf1, 0x03, 0x00, 0x0f, 0xc4, 0x3f, 0xf8, 0x23, 0x88, 0x07, 0xff, 0xf1, \n0xe0, 0x00, 0x00, 0xc7, 0xf8, 0x00, 0x00, 0x1f, 0xfc, 0x7f, 0xe0, 0x3f, 0xff, 0x01, 0xf8, 0xff, \n0xff, 0x80, 0x01, 0xff, 0xff, 0xe3, 0xc7, 0xff, 0xff, 0xf1, 0x8f, 0xff, 0xff, 0xfc, 0x3f, 0xff, \n0xff, 0xff, 0xff, 0xff\n};\n\nuint8_t image2 [1024] = {\n\/\/ 'image2', 128x64px\n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xe0, 0x00, 0x07, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xe0, 0x00, 0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x1e, 0x03, 0xff, 0xff, 0xfe, 0x00, 0x0f, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0xf0, 0x0f, 0xff, 0xff, 0xff, 0xf0, 0x01, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0xe0, 0x07, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x03, 0xc0, 0x07, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x07, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xf8, 0x03, 0xff, 0xf0, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0x00, 0xff, 0xf8, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0x80, 0x3f, 0xfc, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x3c, 0x07, 0xff, 0xfc, 0x00, 0x01, 0xff, 0xff, 0xf0, 0x0f, 0xfe, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x70, 0x3f, 0xff, 0xff, 0xf8, 0x00, 0x1f, 0xff, 0xfc, 0x03, 0xff, 0x00, 0x00, 0x00, \n0x00, 0x00, 0xf0, 0x7f, 0xff, 0xff, 0xff, 0x80, 0x07, 0xff, 0xff, 0x01, 0xff, 0x80, 0x00, 0x00, \n0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0xff, 0xff, 0x80, 0x7f, 0x80, 0x00, 0x00, \n0x00, 0x01, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x7f, 0xff, 0xc0, 0x3f, 0xc0, 0x00, 0x00, \n0x00, 0x01, 0xc1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x0f, 0xff, 0xf0, 0x1f, 0xc0, 0x00, 0x00, \n0x00, 0x01, 0xc1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x07, 0xff, 0xf8, 0x0f, 0xe0, 0x00, 0x00, \n0x00, 0x01, 0xc1, 0xc0, 0x00, 0x00, 0xff, 0xff, 0xfe, 0x01, 0xff, 0xfc, 0x07, 0xe0, 0x00, 0x00, \n0x00, 0x01, 0xc3, 0xc0, 0x00, 0x00, 0x07, 0xff, 0xff, 0x80, 0xff, 0xff, 0x03, 0xe0, 0x00, 0x00, \n0x00, 0x03, 0xc3, 0xc0, 0x1e, 0x00, 0x00, 0xff, 0xff, 0xe0, 0x3f, 0xff, 0x81, 0xf0, 0x00, 0x00, \n0x00, 0x01, 0xc3, 0xcf, 0xff, 0xfe, 0x00, 0x1f, 0xff, 0xf0, 0x1f, 0xff, 0x80, 0xf0, 0x00, 0x00, \n0x00, 0x01, 0xc1, 0xff, 0xff, 0xff, 0xf0, 0x07, 0xff, 0xf8, 0x0f, 0xff, 0xc0, 0x40, 0x00, 0x00, \n0x00, 0x01, 0xc1, 0xff, 0xff, 0xff, 0xfc, 0x01, 0xff, 0xfe, 0x07, 0xff, 0xe0, 0x00, 0x00, 0x00, \n0x00, 0x01, 0xc1, 0xff, 0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0x03, 0xff, 0xf0, 0x00, 0x00, 0x00, \n0x00, 0x01, 0xe1, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x3f, 0xff, 0x01, 0xff, 0xf0, 0x00, 0x00, 0x00, \n0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x1f, 0xff, 0x80, 0xff, 0xf8, 0x00, 0x00, 0x00, \n0x00, 0x00, 0xe0, 0x7f, 0x00, 0x3f, 0xff, 0xf8, 0x0f, 0xff, 0xc0, 0xff, 0xf8, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x70, 0x10, 0x00, 0x03, 0xff, 0xfe, 0x07, 0xff, 0xc0, 0x7f, 0xfc, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0xff, 0xfe, 0x07, 0xff, 0xc0, 0x7f, 0xfc, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x03, 0xff, 0xe0, 0x7f, 0xfc, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x1e, 0x00, 0x3f, 0x00, 0x1f, 0xff, 0x01, 0xff, 0xf0, 0x7f, 0xf8, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x0f, 0x01, 0xff, 0xe0, 0x0f, 0xff, 0x81, 0xff, 0xf0, 0x3f, 0xf0, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x07, 0x81, 0xff, 0xf0, 0x0f, 0xff, 0x81, 0xff, 0xf0, 0x3f, 0xe0, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x01, 0xc3, 0xff, 0xf0, 0x0f, 0xff, 0x81, 0xff, 0xf0, 0x3f, 0x80, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0xf1, 0xff, 0xf0, 0x0f, 0xff, 0x81, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x3d, 0xff, 0xe0, 0x0f, 0xff, 0x81, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x1f, 0xff, 0x80, 0x1f, 0xff, 0x01, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x3f, 0xff, 0x03, 0xff, 0xe0, 0x00, 0xf0, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x01, 0xf0, 0x00, 0x7f, 0xff, 0x07, 0xff, 0xe0, 0x03, 0xc0, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x1f, 0xfe, 0x03, 0xff, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x0f, 0xc0, 0x01, 0xf8, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x01, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xc0, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xe0, 0x00, 0x00, 0x01, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0xe1, 0x0c, 0x78, 0xfe, 0x1f, 0xf0, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0xc0, 0x0c, 0x18, 0x07, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0xf0, 0x0c, 0x18, 0x06, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x07, 0xf8, 0x3e, 0x0c, 0x70, 0x7c, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x03, 0x8c, 0x00, 0x07, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x01, 0x8c, 0x00, 0x03, 0x07, 0x80, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x07, 0xfc, 0x87, 0x0c, 0x01, 0x8f, 0x1f, 0xf8, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x07, 0xfc, 0xfe, 0x0c, 0x00, 0xf8, 0x1f, 0xf8, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\n};\n\n\nvoid app_main(void)\n{\n\tSSD1306_t dev;\n\n#if CONFIG_I2C_INTERFACE\n\tESP_LOGI(TAG, \"INTERFACE is i2c\");\n\tESP_LOGI(TAG, \"CONFIG_SDA_GPIO=%d\",CONFIG_SDA_GPIO);\n\tESP_LOGI(TAG, \"CONFIG_SCL_GPIO=%d\",CONFIG_SCL_GPIO);\n\tESP_LOGI(TAG, \"CONFIG_RESET_GPIO=%d\",CONFIG_RESET_GPIO);\n\ti2c_master_init(&amp;dev, CONFIG_SDA_GPIO, CONFIG_SCL_GPIO, CONFIG_RESET_GPIO);\n#endif \/\/ CONFIG_I2C_INTERFACE\n\n#if CONFIG_SPI_INTERFACE\n\tESP_LOGI(TAG, \"INTERFACE is SPI\");\n\tESP_LOGI(TAG, \"CONFIG_MOSI_GPIO=%d\",CONFIG_MOSI_GPIO);\n\tESP_LOGI(TAG, \"CONFIG_SCLK_GPIO=%d\",CONFIG_SCLK_GPIO);\n\tESP_LOGI(TAG, \"CONFIG_CS_GPIO=%d\",CONFIG_CS_GPIO);\n\tESP_LOGI(TAG, \"CONFIG_DC_GPIO=%d\",CONFIG_DC_GPIO);\n\tESP_LOGI(TAG, \"CONFIG_RESET_GPIO=%d\",CONFIG_RESET_GPIO);\n\tspi_master_init(&amp;dev, CONFIG_MOSI_GPIO, CONFIG_SCLK_GPIO, CONFIG_CS_GPIO, CONFIG_DC_GPIO, CONFIG_RESET_GPIO);\n#endif \/\/ CONFIG_SPI_INTERFACE\n\n#if CONFIG_FLIP\n\tdev._flip = true;\n\tESP_LOGW(TAG, \"Flip upside down\");\n#endif\n\n#if CONFIG_SSD1306_128x64\n\tESP_LOGI(TAG, \"Panel is 128x64\");\n\tssd1306_init(&amp;dev, 128, 64);\n#endif \/\/ CONFIG_SSD1306_128x64\n#if CONFIG_SSD1306_128x32\n\tESP_LOGI(TAG, \"Panel is 128x32\");\n\tssd1306_init(&amp;dev, 128, 32);\n#endif \/\/ CONFIG_SSD1306_128x32\n\n\tssd1306_contrast(&amp;dev, 0xff);\n\n\twhile(1) {\n\t\tssd1306_clear_screen(&amp;dev, false);\n#if CONFIG_SSD1306_128x64\n\t\tssd1306_display_text(&amp;dev, 0, \"OLED IMAGE DEMO\", 15, false);\n#endif \/\/ CONFIG_SSD1306_128x64\n\n#if CONFIG_SSD1306_128x32\n\t\tssd1306_display_text(&amp;dev, 0, \"SSD1306 128x32\", 14, false);\n#endif \/\/ CONFIG_SSD1306_128x32\n\t\t\n\t\tint bitmapWidth = 4*8;\n\t\tint width = ssd1306_get_width(&amp;dev);\n\t\tint xpos = width \/ 2; \/\/ center of width\n\t\txpos = xpos - bitmapWidth\/2; \n\t\tint ypos = 16;\n\t\tESP_LOGD(TAG, \"width=%d xpos=%d\", width, xpos);\n\t\tssd1306_bitmaps(&amp;dev, xpos, ypos, image1, 32, 13, false);\n\t\tvTaskDelay(3000 \/ portTICK_PERIOD_MS);\n\n\t\tfor(int i=0;i&lt;128;i++) {\n\t\t\tssd1306_wrap_arround(&amp;dev, SCROLL_RIGHT, 2, 3, 0);\n\t\t}\n\t\tvTaskDelay(2000 \/ portTICK_PERIOD_MS);\n\n#if CONFIG_SSD1306_128x64\n\t\tssd1306_clear_screen(&amp;dev, false);\n\t\tssd1306_bitmaps(&amp;dev, 0, 0, image2, 128, 64, false);\n\t\tvTaskDelay(2000 \/ portTICK_PERIOD_MS);\n\n\t\tfor(int i=0;i&lt;64;i++) {\n\t\t\tssd1306_wrap_arround(&amp;dev, SCROLL_UP, 0, 127, 0);\n\t\t}\n\t\tvTaskDelay(2000 \/ portTICK_PERIOD_MS);\n\n#endif\n\t}\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Compiling the Sketch<\/h3>\n\n\n\n<p>To flash your chip, type the following command in the serial terminal. Remember to replace the COM port with the one through which your board is connected.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code class=\"\">idf.py -p COMX flash monitor<\/code><\/pre>\n\n\n\n<p>After the code flashes successfully, you can view the informational messages being printed showing the SSD1306 configuration parameters and its status.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"326\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-ImageDemo-project-terminal.jpg?resize=1024%2C326&#038;ssl=1\" alt=\"ESP32 OLED using ESP-IDF ImageDemo project terminal\" class=\"wp-image-898\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-ImageDemo-project-terminal.jpg?resize=1024%2C326&amp;ssl=1 1024w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-ImageDemo-project-terminal.jpg?resize=300%2C95&amp;ssl=1 300w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-ImageDemo-project-terminal.jpg?resize=768%2C244&amp;ssl=1 768w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-ImageDemo-project-terminal.jpg?w=1031&amp;ssl=1 1031w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>The OLED will start displaying the images. Watch the video below to have a better insight.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"(Demo) ESP32 OLED with ESP IDF Display Image\" width=\"1200\" height=\"675\" src=\"https:\/\/www.youtube.com\/embed\/hmMxKA4ImFU?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-station-mode-vs-soft-ap-mode\">ESP32 OLED with ESP-IDF Display Scrolling Image<\/h2>\n\n\n\n<p>In this section, we will demonstrate ImageScrollDemo by nopnop2002 uploaded on GitHub at the following link:<\/p>\n\n\n\n<div class=\"wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-16018d1d wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button has-custom-width wp-block-button__width-25\"><a class=\"wp-block-button__link has-midnight-gradient-background has-background\" href=\"https:\/\/github.com\/nopnop2002\/esp-idf-ssd1306\/tree\/master\/ImageScrollDemo\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>DOWNLOAD<\/strong><\/a><\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Create Project<\/h3>\n\n\n\n<p>Open your VS Code and head over to&nbsp;<strong>View &gt; Command Palette<\/strong>. Type&nbsp;<strong>ESP-IDF: New Project<\/strong>&nbsp;in the search bar and press enter.<\/p>\n\n\n\n<p>Specify the project name and directory. We have named our project \u2018ESP_IDF_SSD1306_ImageScrollDemo.\u2019 For the ESP-IDF board, we have chosen the custom board option. For ESP-IDF target, we have chosen ESP32 module. Click \u2018Choose Template\u2019 button to proceed forward.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"631\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-Create-ImageScrollDemo-project.jpg?resize=1024%2C631&#038;ssl=1\" alt=\"ESP32 OLED using ESP-IDF Create ImageScrollDemo project\" class=\"wp-image-904\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-Create-ImageScrollDemo-project.jpg?resize=1024%2C631&amp;ssl=1 1024w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-Create-ImageScrollDemo-project.jpg?resize=300%2C185&amp;ssl=1 300w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-Create-ImageScrollDemo-project.jpg?resize=768%2C474&amp;ssl=1 768w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-Create-ImageScrollDemo-project.jpg?w=1234&amp;ssl=1 1234w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>In the Extension, select ESP-IDF option:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1347\" height=\"549\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-2.jpg?resize=1024%2C417&amp;ssl=1\" alt=\"ESP-IDF in VS Code New Project 2\" class=\"wp-image-78\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-2.jpg?w=1347&amp;ssl=1 1347w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-2.jpg?resize=300%2C122&amp;ssl=1 300w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-2.jpg?resize=1024%2C417&amp;ssl=1 1024w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-2.jpg?resize=768%2C313&amp;ssl=1 768w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p>We will click the \u2018sample_project\u2019 under the get-started tab. Now click \u2018Create project using template sample_project.\u2019<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1267\" height=\"748\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-3.jpg?resize=1024%2C605&amp;ssl=1\" alt=\"ESP-IDF in VS Code New Project 3\" class=\"wp-image-79\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-3.jpg?w=1267&amp;ssl=1 1267w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-3.jpg?resize=300%2C177&amp;ssl=1 300w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-3.jpg?resize=1024%2C605&amp;ssl=1 1024w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/06\/ESP-IDF-in-VS-Code-New-Project-3.jpg?resize=768%2C453&amp;ssl=1 768w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p>You will get a notification that the project has been created. To open the project in a new window, click \u2018Yes.\u2019<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Add Libraries<\/h3>\n\n\n\n<p>This opens project that we created, inside the EXPLORER tab. There are several folders inside our project folder. Create a new folder named &#8216;<strong>components<\/strong>&#8216; and copy the <a href=\"https:\/\/github.com\/nopnop2002\/esp-idf-ssd1306\/tree\/master\/components\/ssd1306\" target=\"_blank\" rel=\"noopener\">files from this destination into<\/a> your project folder. This will contain the libraries that will be required for this project.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">SSD1306 Configuration<\/h3>\n\n\n\n<p>Let&#8217;s first head over to the <strong>menuconfig<\/strong>. Opens the ESP-IDF SDK Configuration Editor. Scroll down and open the <strong>SSD1306 Configuration<\/strong>. Here we can set the SSD1306 configuration parameter according to our needs. This includes the UART interface, panel type, SCL GPIO pin, SDA GPIO pin and the reset GPIO pin. Here you can view that by default, ESP-IDF is using the interface as I2C, panel type as 128&#215;64, SCL GPIO pin as 22, SDA GPIO pin as 21 and Reset GPIO pin as 33. You can alter these parameters according to your OLED display and then click the Save button found at the top. We will leave the configuration settings as default as they match our module.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"556\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-SDK-configuration-editor-1024x556.jpg?resize=1024%2C556&#038;ssl=1\" alt=\"ESP32 OLED using ESP-IDF TextDemo project SDK configuration editor\" class=\"wp-image-845\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-SDK-configuration-editor.jpg?resize=1024%2C556&amp;ssl=1 1024w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-SDK-configuration-editor.jpg?resize=300%2C163&amp;ssl=1 300w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-SDK-configuration-editor.jpg?resize=768%2C417&amp;ssl=1 768w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-TextDemo-project-SDK-configuration-editor.jpg?w=1333&amp;ssl=1 1333w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>Alternatively, we can also set this config value with menuconfig. Open menuconfig by typing <strong>idf.py menuconfig<\/strong> in the terminal. This command opens the Espressif IoT Development Framework Configuration. Head over to <strong>SSD1306 Configuration<\/strong> and set the parameters accordingly.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Code<\/h3>\n\n\n\n<p>Go to&nbsp;<strong>main &gt; main.c&nbsp;<\/strong>and open it. We will define the functions and the program code here. Copy the code from <a href=\"https:\/\/github.com\/nopnop2002\/esp-idf-ssd1306\/blob\/master\/ImageScrollDemo\/main\/main.c\">this link<\/a> here.<\/p>\n\n\n\n<p>This is our <strong>main.c<\/strong> file.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code class=\"\">#include &lt;stdio.h&gt;\n#include &lt;stdlib.h&gt;\n#include &lt;string.h&gt;\n#include \"freertos\/FreeRTOS.h\"\n#include \"freertos\/task.h\"\n#include \"esp_log.h\"\n\n#include \"ssd1306.h\"\n#include \"font8x8_basic.h\"\n\n\/*\n You have to set this config value with menuconfig\n CONFIG_INTERFACE\n for i2c\n CONFIG_MODEL\n CONFIG_SDA_GPIO\n CONFIG_SCL_GPIO\n CONFIG_RESET_GPIO\n for SPI\n CONFIG_CS_GPIO\n CONFIG_DC_GPIO\n CONFIG_RESET_GPIO\n*\/\n\n#define TAG \"SSD1306\"\n\n#define NUM_IMAGES 7\n\n#define IMAGE_WIDTH 48\n\n\/\/ (48\/6)*62=372\n#define BITMAPS 372\nuint8_t segmentDisplay[NUM_IMAGES][BITMAPS] = {\n{\n\/\/ https:\/\/www.iconspng.com\/image\/94065\/16-segment-display-h\n\/\/ '16-segment-display-h', 48x62px\n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x30, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x70, \n0x00, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x0f, 0x00, 0x00, \n0x00, 0xf0, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x1e, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x1e, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x1e, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x1e, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x1e, 0x00, 0x00, 0x01, 0xc0, 0x00, 0x1e, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x3c, 0x00, 0x00, \n0x03, 0xc0, 0x00, 0x3c, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x3c, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x3c, \n0x00, 0x00, 0x03, 0xc0, 0x00, 0x3c, 0x00, 0x00, 0x07, 0x80, 0x00, 0x78, 0x00, 0x00, 0x07, 0x80, \n0x00, 0x78, 0x00, 0x00, 0x07, 0x80, 0x00, 0x78, 0x00, 0x00, 0x07, 0x80, 0x00, 0x78, 0x00, 0x00, \n0x07, 0x80, 0x00, 0x78, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x70, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x27, \n0xf8, 0x1f, 0xf6, 0x00, 0x00, 0x1f, 0xfe, 0x7f, 0xf8, 0x00, 0x00, 0x1f, 0xfc, 0x7f, 0xf0, 0x00, \n0x00, 0x6f, 0xf0, 0x1f, 0xee, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x1e, 0x00, 0x01, 0xe0, 0x00, 0x00, \n0x1e, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x1e, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x1e, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x3e, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x3c, 0x00, 0x03, 0xe0, 0x00, 0x00, 0x3c, 0x00, \n0x03, 0xc0, 0x00, 0x00, 0x3c, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x3c, 0x00, 0x03, 0xc0, 0x00, 0x00, \n0x3c, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x78, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x78, 0x00, 0x07, 0x80, \n0x00, 0x00, 0x78, 0x00, 0x07, 0x80, 0x00, 0x00, 0x78, 0x00, 0x07, 0x80, 0x00, 0x00, 0x78, 0x00, \n0x07, 0x80, 0x00, 0x00, 0x78, 0x00, 0x07, 0x80, 0x00, 0x00, 0xf0, 0x00, 0x0f, 0x00, 0x00, 0x00, \n0xf0, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x0f, 0x00, \n0x00, 0x00, 0xf0, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x60, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00\n},\n{\n\/\/ https:\/\/www.iconspng.com\/image\/94062\/16-segment-display-e\n\/\/ '16-segment-display-e', 48x62px\n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0xff, 0xc0, 0xff, 0x80, 0x00, 0x01, 0xff, 0xe1, 0xff, 0xc0, 0x00, 0x01, \n0xff, 0xf3, 0xff, 0xc0, 0x00, 0x06, 0xff, 0xe3, 0xff, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x27, \n0xf8, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xfc, 0x00, 0x00, 0x00, \n0x00, 0x6f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xe0, 0x00, 0x00, 0x00, 0x00, \n0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, \n0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x07, 0x80, \n0x00, 0x00, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x00, 0x00, \n0x07, 0x80, 0x00, 0x00, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0xff, 0xc7, 0xff, 0x00, 0x00, \n0x03, 0xff, 0xcf, 0xff, 0x80, 0x00, 0x07, 0xff, 0x87, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00\n},\n{\n\/\/ '16-segment-display-l', 48x62px\n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xe0, 0x00, 0x00, 0x00, 0x00, \n0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, \n0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x07, 0x80, \n0x00, 0x00, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x00, 0x00, \n0x07, 0x80, 0x00, 0x00, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0xff, 0xc7, 0xff, 0x00, 0x00, \n0x03, 0xff, 0xcf, 0xff, 0x80, 0x00, 0x07, 0xff, 0x87, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00\n},\n{\n\/\/ '16-segment-display-o', 48x62px\n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0xff, 0xc0, 0xff, 0xc0, 0x00, 0x01, 0xff, 0xe1, 0xff, 0xc0, 0x00, 0x01, \n0xff, 0xf3, 0xff, 0xc0, 0x00, 0x06, 0xff, 0xe3, 0xff, 0x30, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x70, \n0x00, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x0f, 0x00, 0x00, \n0x00, 0xf0, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x1e, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x1e, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x1e, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x1e, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x1e, 0x00, 0x00, 0x01, 0xc0, 0x00, 0x1e, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x3c, 0x00, 0x00, \n0x03, 0xc0, 0x00, 0x3c, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x3c, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x3c, \n0x00, 0x00, 0x03, 0xc0, 0x00, 0x3c, 0x00, 0x00, 0x07, 0x80, 0x00, 0x78, 0x00, 0x00, 0x07, 0x80, \n0x00, 0x78, 0x00, 0x00, 0x07, 0x80, 0x00, 0x78, 0x00, 0x00, 0x07, 0x80, 0x00, 0x78, 0x00, 0x00, \n0x07, 0x80, 0x00, 0x78, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x70, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x20, \n0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x60, 0x00, 0x00, 0x0e, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x1e, 0x00, 0x01, 0xe0, 0x00, 0x00, \n0x1e, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x1e, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x1e, 0x00, 0x01, 0xe0, \n0x00, 0x00, 0x3e, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x3c, 0x00, 0x03, 0xe0, 0x00, 0x00, 0x3c, 0x00, \n0x03, 0xc0, 0x00, 0x00, 0x3c, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x3c, 0x00, 0x03, 0xc0, 0x00, 0x00, \n0x3c, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x78, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x78, 0x00, 0x07, 0x80, \n0x00, 0x00, 0x78, 0x00, 0x07, 0x80, 0x00, 0x00, 0x78, 0x00, 0x07, 0x80, 0x00, 0x00, 0x78, 0x00, \n0x07, 0x80, 0x00, 0x00, 0x78, 0x00, 0x07, 0x80, 0x00, 0x00, 0xf0, 0x00, 0x0f, 0x00, 0x00, 0x00, \n0xf0, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x0f, 0x00, \n0x00, 0x00, 0xf0, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x0d, 0xff, 0xc7, 0xff, 0x60, 0x00, \n0x03, 0xff, 0xcf, 0xff, 0x80, 0x00, 0x07, 0xff, 0x87, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00\n},\n{\n\/\/ '16-segment-display-w', 48x62px\n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x30, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x70, \n0x00, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x0f, 0x00, 0x00, \n0x00, 0xf0, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x1e, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x1e, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x1e, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x1e, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x1e, 0x00, 0x00, 0x01, 0xc0, 0x00, 0x1e, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x3c, 0x00, 0x00, \n0x03, 0xc0, 0x00, 0x3c, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x3c, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x3c, \n0x00, 0x00, 0x03, 0xc0, 0x00, 0x3c, 0x00, 0x00, 0x07, 0x80, 0x00, 0x78, 0x00, 0x00, 0x07, 0x80, \n0x00, 0x78, 0x00, 0x00, 0x07, 0x80, 0x00, 0x78, 0x00, 0x00, 0x07, 0x80, 0x00, 0x78, 0x00, 0x00, \n0x07, 0x80, 0x00, 0x78, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x70, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x20, \n0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, \n0x00, 0x60, 0x06, 0xc0, 0x0e, 0x00, 0x00, 0xf0, 0x1c, 0xe0, 0x1e, 0x00, 0x01, 0xe0, 0x1c, 0x60, \n0x1e, 0x00, 0x01, 0xe0, 0x38, 0x70, 0x1e, 0x00, 0x01, 0xe0, 0x78, 0x70, 0x1e, 0x00, 0x01, 0xe0, \n0xf0, 0x70, 0x3e, 0x00, 0x01, 0xe0, 0xf0, 0x78, 0x3c, 0x00, 0x03, 0xe1, 0xe0, 0x78, 0x3c, 0x00, \n0x03, 0xc3, 0xe0, 0x78, 0x3c, 0x00, 0x03, 0xc3, 0xc0, 0x3c, 0x3c, 0x00, 0x03, 0xc7, 0xc0, 0x3c, \n0x3c, 0x00, 0x03, 0xcf, 0x80, 0x3e, 0x78, 0x00, 0x07, 0xdf, 0x00, 0x1e, 0x78, 0x00, 0x07, 0x9e, \n0x00, 0x1e, 0x78, 0x00, 0x07, 0xbe, 0x00, 0x1f, 0x78, 0x00, 0x07, 0xbc, 0x00, 0x0f, 0x78, 0x00, \n0x07, 0xf8, 0x00, 0x0f, 0x78, 0x00, 0x07, 0xf8, 0x00, 0x07, 0xf0, 0x00, 0x0f, 0x70, 0x00, 0x07, \n0xf0, 0x00, 0x0f, 0x40, 0x00, 0x02, 0xf0, 0x00, 0x0f, 0x00, 0x00, 0x03, 0xf0, 0x00, 0x0f, 0x00, \n0x00, 0x00, 0xf0, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x60, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00\n},\n{\n\/\/ '16-segment-display-r', 48x62px\n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0xff, 0xc0, 0xff, 0xc0, 0x00, 0x01, 0xff, 0xe1, 0xff, 0xc0, 0x00, 0x01, \n0xff, 0xf3, 0xff, 0xc0, 0x00, 0x06, 0xff, 0xe3, 0xff, 0x30, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x70, \n0x00, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x0f, 0x00, 0x00, \n0x00, 0xf0, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x1e, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x1e, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x1e, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x1e, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x1e, 0x00, 0x00, 0x01, 0xc0, 0x00, 0x1e, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x3c, 0x00, 0x00, \n0x03, 0xc0, 0x00, 0x3c, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x3c, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x3c, \n0x00, 0x00, 0x03, 0xc0, 0x00, 0x3c, 0x00, 0x00, 0x07, 0x80, 0x00, 0x78, 0x00, 0x00, 0x07, 0x80, \n0x00, 0x78, 0x00, 0x00, 0x07, 0x80, 0x00, 0x78, 0x00, 0x00, 0x07, 0x80, 0x00, 0x78, 0x00, 0x00, \n0x07, 0x80, 0x00, 0x78, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x70, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x27, \n0xf8, 0x1f, 0xf6, 0x00, 0x00, 0x1f, 0xfe, 0x7f, 0xf8, 0x00, 0x00, 0x1f, 0xfc, 0xff, 0xf0, 0x00, \n0x00, 0x6f, 0xf0, 0xdf, 0xe0, 0x00, 0x00, 0xf0, 0x00, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x60, \n0x00, 0x00, 0x01, 0xe0, 0x00, 0x70, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x70, 0x00, 0x00, 0x01, 0xe0, \n0x00, 0x70, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x78, 0x00, 0x00, 0x03, 0xe0, 0x00, 0x78, 0x00, 0x00, \n0x03, 0xc0, 0x00, 0x78, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x3c, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x3c, \n0x00, 0x00, 0x03, 0xc0, 0x00, 0x3e, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x1e, 0x00, 0x00, 0x07, 0x80, \n0x00, 0x1e, 0x00, 0x00, 0x07, 0x80, 0x00, 0x1f, 0x00, 0x00, 0x07, 0x80, 0x00, 0x0f, 0x00, 0x00, \n0x07, 0x80, 0x00, 0x0f, 0x00, 0x00, 0x07, 0x80, 0x00, 0x07, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x07, \n0x00, 0x00, 0x0f, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0f, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00\n},\n{\n\/\/ '16-segment-display-d', 48x62px\n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0xff, 0xc0, 0xff, 0xc0, 0x00, 0x01, 0xff, 0xe1, 0xff, 0xc0, 0x00, 0x01, \n0xff, 0xf3, 0xff, 0xc0, 0x00, 0x00, 0xff, 0xeb, 0xff, 0x30, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x70, \n0x00, 0x00, 0x00, 0x3c, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x3c, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x3c, \n0x00, 0xf0, 0x00, 0x00, 0x00, 0x7c, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x78, 0x01, 0xe0, 0x00, 0x00, \n0x00, 0x78, 0x01, 0xe0, 0x00, 0x00, 0x00, 0x78, 0x01, 0xe0, 0x00, 0x00, 0x00, 0x78, 0x01, 0xe0, \n0x00, 0x00, 0x00, 0xf8, 0x01, 0xc0, 0x00, 0x00, 0x00, 0xf0, 0x03, 0xc0, 0x00, 0x00, 0x00, 0xf0, \n0x03, 0xc0, 0x00, 0x00, 0x00, 0xf0, 0x03, 0xc0, 0x00, 0x00, 0x00, 0xf0, 0x03, 0xc0, 0x00, 0x00, \n0x01, 0xf0, 0x03, 0xc0, 0x00, 0x00, 0x01, 0xf0, 0x07, 0x80, 0x00, 0x00, 0x01, 0xe0, 0x07, 0x80, \n0x00, 0x00, 0x01, 0xe0, 0x07, 0x80, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x80, 0x00, 0x00, 0x00, 0xc0, \n0x07, 0x80, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x03, 0x00, \n0x1e, 0x00, 0x00, 0x00, 0x03, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x03, 0x00, 0x1e, 0x00, 0x00, 0x00, \n0x07, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x07, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x3c, 0x00, \n0x00, 0x00, 0x0f, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x0f, 0x00, \n0x3c, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x78, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x78, 0x00, 0x00, 0x00, \n0x1e, 0x00, 0x78, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x78, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x78, 0x00, \n0x00, 0x00, 0x1e, 0x00, 0x78, 0x00, 0x00, 0x00, 0x3e, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x3c, 0x00, \n0xf0, 0x00, 0x00, 0x00, 0x3c, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x3c, 0x00, 0xf0, 0x00, 0x00, 0x00, \n0x3c, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x38, 0x00, 0xf0, 0x00, 0x01, 0xff, 0xc7, 0xff, 0x60, 0x00, \n0x03, 0xff, 0xcf, 0xff, 0x80, 0x00, 0x07, 0xff, 0x87, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00\n}\n};\n\n\/\/                  H  E  L  L  O  SP  W  O  R  L  D\nint imageTable[] = {0, 1, 2, 2, 3, -1, 4, 3, 5, 2, 6};\n\n\nvoid app_main(void)\n{\n\tSSD1306_t dev;\n\n#if CONFIG_I2C_INTERFACE\n\tESP_LOGI(TAG, \"INTERFACE is i2c\");\n\tESP_LOGI(TAG, \"CONFIG_SDA_GPIO=%d\",CONFIG_SDA_GPIO);\n\tESP_LOGI(TAG, \"CONFIG_SCL_GPIO=%d\",CONFIG_SCL_GPIO);\n\tESP_LOGI(TAG, \"CONFIG_RESET_GPIO=%d\",CONFIG_RESET_GPIO);\n\ti2c_master_init(&amp;dev, CONFIG_SDA_GPIO, CONFIG_SCL_GPIO, CONFIG_RESET_GPIO);\n#endif \/\/ CONFIG_I2C_INTERFACE\n\n#if CONFIG_SPI_INTERFACE\n\tESP_LOGI(TAG, \"INTERFACE is SPI\");\n\tESP_LOGI(TAG, \"CONFIG_MOSI_GPIO=%d\",CONFIG_MOSI_GPIO);\n\tESP_LOGI(TAG, \"CONFIG_SCLK_GPIO=%d\",CONFIG_SCLK_GPIO);\n\tESP_LOGI(TAG, \"CONFIG_CS_GPIO=%d\",CONFIG_CS_GPIO);\n\tESP_LOGI(TAG, \"CONFIG_DC_GPIO=%d\",CONFIG_DC_GPIO);\n\tESP_LOGI(TAG, \"CONFIG_RESET_GPIO=%d\",CONFIG_RESET_GPIO);\n\tspi_master_init(&amp;dev, CONFIG_MOSI_GPIO, CONFIG_SCLK_GPIO, CONFIG_CS_GPIO, CONFIG_DC_GPIO, CONFIG_RESET_GPIO);\n#endif \/\/ CONFIG_SPI_INTERFACE\n\n#if CONFIG_FLIP\n\tdev._flip = true;\n\tESP_LOGW(TAG, \"Flip upside down\");\n#endif\n\n#if CONFIG_SSD1306_128x64\n\tESP_LOGI(TAG, \"Panel is 128x64\");\n\tssd1306_init(&amp;dev, 128, 64);\n#endif \/\/ CONFIG_SSD1306_128x64\n#if CONFIG_SSD1306_128x32\n\tESP_LOGE(TAG, \"Panel is 128x32. This demo cannot be run.\");\n\twhile(1) { vTaskDelay(1); }\n#endif \/\/ CONFIG_SSD1306_128x32\n\tssd1306_contrast(&amp;dev, 0xff);\n\n\tint numOfTable = sizeof(imageTable)\/sizeof(int);\n\tESP_LOGI(TAG, \"numOfTable=%d\", numOfTable);\n\t\/\/ Allocate memory\n\tuint8_t *buffer = (uint8_t *)malloc(8*128); \/\/ 8 page 128 pixel\n\tif (buffer == NULL) {\n\t\tESP_LOGE(TAG, \"malloc failed\");\n\t\twhile(1) { vTaskDelay(1); }\n\t}\n\tuint8_t *segmentImage = (uint8_t *)malloc(NUM_IMAGES*8*IMAGE_WIDTH); \/\/ 10 image 8 page 48 pixel\n\tif (segmentImage == NULL) {\n\t\tESP_LOGE(TAG, \"malloc failed\");\n\t\twhile(1) { vTaskDelay(1); }\n\t}\n\n\t\/\/ Convert from segmentDisplay to segmentImage\n\tfor (int imageIndex=0;imageIndex&lt;NUM_IMAGES;imageIndex++) {\n\t\tssd1306_clear_screen(&amp;dev, false);\n\t\tssd1306_bitmaps(&amp;dev, 0, 1, segmentDisplay[imageIndex], IMAGE_WIDTH, 62, false);\n\t\tvTaskDelay(200 \/ portTICK_PERIOD_MS);\n\n\t\t\/\/ Get from internal buffer to local buffer\n\t\t\/\/ buffer is [8][128] 8 page 128 pixel\n\t\tssd1306_get_buffer(&amp;dev, buffer);\n\n\t\t\/\/ Save from buffer to segmentImage\n\t\t\/\/ segmentImage is [10][8][IMAGE_WIDTH] 10 image 8 page 48 pixel\n\t\tint segmentImageIndex = imageIndex * BITMAPS;\n\t\tfor (int page=0;page&lt;8;page++) {\n\t\t\t\/\/ESP_LOGI(TAG, \"segmentImageIndex+page*IMAGE_WIDTH=%d\", segmentImageIndex+page*IMAGE_WIDTH);\n\t\t\tmemcpy(&amp;segmentImage[segmentImageIndex+page*IMAGE_WIDTH], &amp;buffer[page*128], IMAGE_WIDTH);\n\t\t\t\/\/ESP_LOGI(TAG, \"page=%d\", page);\n\t\t\t\/\/ESP_LOG_BUFFER_HEXDUMP(TAG, &amp;buffer[page*128], IMAGE_WIDTH, ESP_LOG_INFO);\n\t\t}\n\n#if 0\n\t\tssd1306_clear_screen(&amp;dev, false);\n\t\tfor (int page=0;page&lt;8;page++) {\n\t\t\tssd1306_display_image(&amp;dev, page, 0, &amp;segmentImage[segmentImageIndex+page*IMAGE_WIDTH], IMAGE_WIDTH);\n\t\t\t\/\/ESP_LOGI(TAG, \"page=%d\", page);\n\t\t\t\/\/ESP_LOG_BUFFER_HEXDUMP(TAG, &amp;segmentImage[segmentImageIndex+page*IMAGE_WIDTH], IMAGE_WIDTH, ESP_LOG_INFO);\n\t\t}\n\t\tvTaskDelay(1000 \/ portTICK_PERIOD_MS);\n#endif\n\t}\n\n\tint imageIndex = 0;\n\tint imageSegment = 0;\n\tssd1306_clear_screen(&amp;dev, false);\n\n\twhile(1) {\n\n\t\t\/\/ Shift segment data left by 2 bits\n\t\tfor (int page=0;page&lt;8;page++) {\n\t\t\tint bufferIndex = page*128;\n\t\t\tmemcpy(&amp;buffer[bufferIndex], &amp;buffer[bufferIndex+2], 126);\n\t\t}\n\n\t\t\/\/ Insert 2 bits at the end of segment data\n\t\tif (imageTable[imageIndex] &gt;= 0) {\n\t\t\tint segmentImageIndex = imageTable[imageIndex] * BITMAPS;\n\t\t\tfor (int page=0;page&lt;8;page++) {\n\t\t\t\tint bufferIndex = page*128+126;\n\t\t\t\tbuffer[bufferIndex] = segmentImage[segmentImageIndex+page*IMAGE_WIDTH+imageSegment];\n\t\t\t\tbuffer[bufferIndex+1] = segmentImage[segmentImageIndex+page*IMAGE_WIDTH+imageSegment+1];\n\t\t\t}\n\t\t} else {\n\t\t\tfor (int page=0;page&lt;8;page++) {\n\t\t\t\tint bufferIndex = page*128+126;\n\t\t\t\tbuffer[bufferIndex] = 0;\n\t\t\t\tbuffer[bufferIndex+1] = 0;\n\t\t\t}\n\t\t}\n\t\timageSegment=imageSegment+2;\t\n\t\tssd1306_set_buffer(&amp;dev, buffer);\n\t\tssd1306_show_buffer(&amp;dev);\n\t\t\/\/vTaskDelay(5);\n\n\t\t\/\/ End of display of one character\n\t\tif (imageSegment == IMAGE_WIDTH) {\n\t\t\timageIndex++;\n\t\t\tif (imageIndex == numOfTable) {\n\t\t\t\t\/\/ All characters have been displayed.\n\t\t\t\t\/\/ Scroll to last character.\n\t\t\t\tfor (int segs=0;segs&lt;64;segs++) {\n\t\t\t\t\tfor (int page=0;page&lt;8;page++) {\n\t\t\t\t\t\tint bufferIndex = page*128;\n\t\t\t\t\t\tmemcpy(&amp;buffer[bufferIndex], &amp;buffer[bufferIndex+2], 126);\n\t\t\t\t\t}\n\t\t\t\t\tfor (int page=0;page&lt;8;page++) {\n\t\t\t\t\t\tint bufferIndex = page*128+126;\n\t\t\t\t\t\tbuffer[bufferIndex]=0;\n\t\t\t\t\t\tbuffer[bufferIndex+1]=0;\n\t\t\t\t\t}\n\t\t\t\t\tssd1306_set_buffer(&amp;dev, buffer);\n\t\t\t\t\tssd1306_show_buffer(&amp;dev);\n\t\t\t\t}\n\t\t\t\timageIndex = 0;\n\t\t\t}\n\t\t\timageSegment = 0;\n\t\t}\n\t} \/\/ end while\n\tfree(buffer);\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Compiling the Sketch<\/h3>\n\n\n\n<p>To flash your chip, type the following command in the serial terminal. Remember to replace the COM port with the one through which your board is connected.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code class=\"\">idf.py -p COMX flash monitor<\/code><\/pre>\n\n\n\n<p>After the code flashes successfully, you can view the informational messages being printed showing the SSD1306 configuration parameters and its status.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"324\" src=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-ImageScrollDemo-project-terminal.jpg?resize=1024%2C324&#038;ssl=1\" alt=\"ESP32 OLED using ESP-IDF ImageScrollDemo project terminal\" class=\"wp-image-899\" srcset=\"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-ImageScrollDemo-project-terminal.jpg?resize=1024%2C324&amp;ssl=1 1024w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-ImageScrollDemo-project-terminal.jpg?resize=300%2C95&amp;ssl=1 300w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-ImageScrollDemo-project-terminal.jpg?resize=768%2C243&amp;ssl=1 768w, https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/ESP32-OLED-using-ESP-IDF-ImageScrollDemo-project-terminal.jpg?w=1035&amp;ssl=1 1035w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>The OLED will start displaying the alphabets images that will scroll across the screen, showing the message HELLO WORLD. Watch the video below to have a better insight.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"(Demo) ESP32 OLED with ESP IDF Display Scrolling Image\" width=\"1200\" height=\"675\" src=\"https:\/\/www.youtube.com\/embed\/PgpRXAdTQms?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>You may also like to read: <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/esp32tutorials.com\/i2c-lcd-esp32-esp-idf\/\">I2C LCD with ESP32 using ESP-IDF<\/a><\/li><li><a href=\"https:\/\/esp32tutorials.com\/esp32-uart-tutorial-esp-idf\/\">ESP32 UART Communication using ESP-IDF<\/a><\/li><li><a href=\"https:\/\/esp32tutorials.com\/esp32-access-point-ap-esp-idf\/\">ESP32 Set an Access Point (AP) using ESP-IDF<\/a><\/li><li><a href=\"https:\/\/esp32tutorials.com\/esp32-esp-idf-connect-wifi-station-mode-example\/\">ESP32 ESP-IDF Connect with WiFi \u2013 Station Mode Example<\/a><\/li><li><a href=\"https:\/\/esp32tutorials.com\/esp32-esp-idf-freertos-semaphore-tutorial\/\">ESP32 ESP-IDF FreeRTOS Semaphore \u2013 Tasks Synchronization Examples<\/a><\/li><li><a href=\"https:\/\/esp32tutorials.com\/esp32-pwm-esp-idf-led-brightness-control\/\">ESP32 PWM ESP-IDF LED Brightness Control Example<\/a><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>In this ESP-IDF tutorial, we will show you how to interface SSD1306 OLED with ESP32. Organic Light Emitting Diode commonly known as OLED is used to display texts, bitmap images, &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Interface OLED with ESP32 using ESP-IDF\" class=\"read-more button\" href=\"https:\/\/esp32tutorials.com\/oled-esp32-esp-idf-tutorial\/#more-814\" aria-label=\"Read more about Interface OLED with ESP32 using ESP-IDF\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[9],"tags":[],"class_list":["post-814","post","type-post","status-publish","format-standard","hentry","category-esp32-esp-idf-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Interface OLED Display with ESP32 using ESP-IDF<\/title>\n<meta name=\"description\" content=\"A tutorial to interface OLED Display module with ESP32 using ESP-IDF display text, scrolling images, scrolling text, counter values, animations with examples\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/esp32tutorials.com\/oled-esp32-esp-idf-tutorial\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Interface OLED Display with ESP32 using ESP-IDF\" \/>\n<meta property=\"og:description\" content=\"A tutorial to interface OLED Display module with ESP32 using ESP-IDF display text, scrolling images, scrolling text, counter values, animations with examples\" \/>\n<meta property=\"og:url\" content=\"https:\/\/esp32tutorials.com\/oled-esp32-esp-idf-tutorial\/\" \/>\n<meta property=\"og:site_name\" content=\"ESP32 ESP-IDF\" \/>\n<meta property=\"article:published_time\" content=\"2022-09-18T12:28:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-09-18T12:28:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/OLED-Pinout-I2C.jpg\" \/>\n<meta name=\"author\" content=\"Bilal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Bilal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"92 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/esp32tutorials.com\\\/oled-esp32-esp-idf-tutorial\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/esp32tutorials.com\\\/oled-esp32-esp-idf-tutorial\\\/\"},\"author\":{\"name\":\"Bilal\",\"@id\":\"https:\\\/\\\/esp32tutorials.com\\\/#\\\/schema\\\/person\\\/d648bc7f340c02d211193ac9efc2e3a5\"},\"headline\":\"Interface OLED with ESP32 using ESP-IDF\",\"datePublished\":\"2022-09-18T12:28:07+00:00\",\"dateModified\":\"2022-09-18T12:28:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/esp32tutorials.com\\\/oled-esp32-esp-idf-tutorial\\\/\"},\"wordCount\":4170,\"commentCount\":7,\"publisher\":{\"@id\":\"https:\\\/\\\/esp32tutorials.com\\\/#\\\/schema\\\/person\\\/d648bc7f340c02d211193ac9efc2e3a5\"},\"image\":{\"@id\":\"https:\\\/\\\/esp32tutorials.com\\\/oled-esp32-esp-idf-tutorial\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/esp32tutorials.com\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/OLED-Pinout-I2C.jpg\",\"articleSection\":[\"ESP32 Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/esp32tutorials.com\\\/oled-esp32-esp-idf-tutorial\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/esp32tutorials.com\\\/oled-esp32-esp-idf-tutorial\\\/\",\"url\":\"https:\\\/\\\/esp32tutorials.com\\\/oled-esp32-esp-idf-tutorial\\\/\",\"name\":\"Interface OLED Display with ESP32 using ESP-IDF\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/esp32tutorials.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/esp32tutorials.com\\\/oled-esp32-esp-idf-tutorial\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/esp32tutorials.com\\\/oled-esp32-esp-idf-tutorial\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/esp32tutorials.com\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/OLED-Pinout-I2C.jpg\",\"datePublished\":\"2022-09-18T12:28:07+00:00\",\"dateModified\":\"2022-09-18T12:28:10+00:00\",\"description\":\"A tutorial to interface OLED Display module with ESP32 using ESP-IDF display text, scrolling images, scrolling text, counter values, animations with examples\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/esp32tutorials.com\\\/oled-esp32-esp-idf-tutorial\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/esp32tutorials.com\\\/oled-esp32-esp-idf-tutorial\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/esp32tutorials.com\\\/oled-esp32-esp-idf-tutorial\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/esp32tutorials.com\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/OLED-Pinout-I2C.jpg?fit=636%2C626&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/esp32tutorials.com\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/OLED-Pinout-I2C.jpg?fit=636%2C626&ssl=1\",\"width\":636,\"height\":626,\"caption\":\"OLED Pinout I2C\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/esp32tutorials.com\\\/oled-esp32-esp-idf-tutorial\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/esp32tutorials.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Interface OLED with ESP32 using ESP-IDF\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/esp32tutorials.com\\\/#website\",\"url\":\"https:\\\/\\\/esp32tutorials.com\\\/\",\"name\":\"ESP32 ESP-IDF\",\"description\":\"ESP32 ESP IDF Tutorials and Projects\",\"publisher\":{\"@id\":\"https:\\\/\\\/esp32tutorials.com\\\/#\\\/schema\\\/person\\\/d648bc7f340c02d211193ac9efc2e3a5\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/esp32tutorials.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/esp32tutorials.com\\\/#\\\/schema\\\/person\\\/d648bc7f340c02d211193ac9efc2e3a5\",\"name\":\"Bilal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/esp32tutorials.com\\\/wp-content\\\/litespeed\\\/avatar\\\/b623b0da24dec30042f1540f5437f129.jpg?ver=1775014292\",\"url\":\"https:\\\/\\\/esp32tutorials.com\\\/wp-content\\\/litespeed\\\/avatar\\\/b623b0da24dec30042f1540f5437f129.jpg?ver=1775014292\",\"contentUrl\":\"https:\\\/\\\/esp32tutorials.com\\\/wp-content\\\/litespeed\\\/avatar\\\/b623b0da24dec30042f1540f5437f129.jpg?ver=1775014292\",\"caption\":\"Bilal\"},\"logo\":{\"@id\":\"https:\\\/\\\/esp32tutorials.com\\\/wp-content\\\/litespeed\\\/avatar\\\/b623b0da24dec30042f1540f5437f129.jpg?ver=1775014292\"},\"description\":\"We are a team of experienced Embedded Software Developers with skills in developing Embedded Linux, RTOS, and IoT products from scratch to deployment with a demonstrated history of working in the embedded software industry. Contact us for your projects: admin@esp32tutorials.com\",\"sameAs\":[\"http:\\\/\\\/esp32tutorials.com\"],\"url\":\"https:\\\/\\\/esp32tutorials.com\\\/author\\\/esp32tutorialslab\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Interface OLED Display with ESP32 using ESP-IDF","description":"A tutorial to interface OLED Display module with ESP32 using ESP-IDF display text, scrolling images, scrolling text, counter values, animations with examples","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/esp32tutorials.com\/oled-esp32-esp-idf-tutorial\/","og_locale":"en_US","og_type":"article","og_title":"Interface OLED Display with ESP32 using ESP-IDF","og_description":"A tutorial to interface OLED Display module with ESP32 using ESP-IDF display text, scrolling images, scrolling text, counter values, animations with examples","og_url":"https:\/\/esp32tutorials.com\/oled-esp32-esp-idf-tutorial\/","og_site_name":"ESP32 ESP-IDF","article_published_time":"2022-09-18T12:28:07+00:00","article_modified_time":"2022-09-18T12:28:10+00:00","og_image":[{"url":"https:\/\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/OLED-Pinout-I2C.jpg","type":"","width":"","height":""}],"author":"Bilal","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Bilal","Est. reading time":"92 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/esp32tutorials.com\/oled-esp32-esp-idf-tutorial\/#article","isPartOf":{"@id":"https:\/\/esp32tutorials.com\/oled-esp32-esp-idf-tutorial\/"},"author":{"name":"Bilal","@id":"https:\/\/esp32tutorials.com\/#\/schema\/person\/d648bc7f340c02d211193ac9efc2e3a5"},"headline":"Interface OLED with ESP32 using ESP-IDF","datePublished":"2022-09-18T12:28:07+00:00","dateModified":"2022-09-18T12:28:10+00:00","mainEntityOfPage":{"@id":"https:\/\/esp32tutorials.com\/oled-esp32-esp-idf-tutorial\/"},"wordCount":4170,"commentCount":7,"publisher":{"@id":"https:\/\/esp32tutorials.com\/#\/schema\/person\/d648bc7f340c02d211193ac9efc2e3a5"},"image":{"@id":"https:\/\/esp32tutorials.com\/oled-esp32-esp-idf-tutorial\/#primaryimage"},"thumbnailUrl":"https:\/\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/OLED-Pinout-I2C.jpg","articleSection":["ESP32 Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/esp32tutorials.com\/oled-esp32-esp-idf-tutorial\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/esp32tutorials.com\/oled-esp32-esp-idf-tutorial\/","url":"https:\/\/esp32tutorials.com\/oled-esp32-esp-idf-tutorial\/","name":"Interface OLED Display with ESP32 using ESP-IDF","isPartOf":{"@id":"https:\/\/esp32tutorials.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/esp32tutorials.com\/oled-esp32-esp-idf-tutorial\/#primaryimage"},"image":{"@id":"https:\/\/esp32tutorials.com\/oled-esp32-esp-idf-tutorial\/#primaryimage"},"thumbnailUrl":"https:\/\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/OLED-Pinout-I2C.jpg","datePublished":"2022-09-18T12:28:07+00:00","dateModified":"2022-09-18T12:28:10+00:00","description":"A tutorial to interface OLED Display module with ESP32 using ESP-IDF display text, scrolling images, scrolling text, counter values, animations with examples","breadcrumb":{"@id":"https:\/\/esp32tutorials.com\/oled-esp32-esp-idf-tutorial\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/esp32tutorials.com\/oled-esp32-esp-idf-tutorial\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/esp32tutorials.com\/oled-esp32-esp-idf-tutorial\/#primaryimage","url":"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/OLED-Pinout-I2C.jpg?fit=636%2C626&ssl=1","contentUrl":"https:\/\/i0.wp.com\/esp32tutorials.com\/wp-content\/uploads\/2022\/08\/OLED-Pinout-I2C.jpg?fit=636%2C626&ssl=1","width":636,"height":626,"caption":"OLED Pinout I2C"},{"@type":"BreadcrumbList","@id":"https:\/\/esp32tutorials.com\/oled-esp32-esp-idf-tutorial\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/esp32tutorials.com\/"},{"@type":"ListItem","position":2,"name":"Interface OLED with ESP32 using ESP-IDF"}]},{"@type":"WebSite","@id":"https:\/\/esp32tutorials.com\/#website","url":"https:\/\/esp32tutorials.com\/","name":"ESP32 ESP-IDF","description":"ESP32 ESP IDF Tutorials and Projects","publisher":{"@id":"https:\/\/esp32tutorials.com\/#\/schema\/person\/d648bc7f340c02d211193ac9efc2e3a5"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/esp32tutorials.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/esp32tutorials.com\/#\/schema\/person\/d648bc7f340c02d211193ac9efc2e3a5","name":"Bilal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/esp32tutorials.com\/wp-content\/litespeed\/avatar\/b623b0da24dec30042f1540f5437f129.jpg?ver=1775014292","url":"https:\/\/esp32tutorials.com\/wp-content\/litespeed\/avatar\/b623b0da24dec30042f1540f5437f129.jpg?ver=1775014292","contentUrl":"https:\/\/esp32tutorials.com\/wp-content\/litespeed\/avatar\/b623b0da24dec30042f1540f5437f129.jpg?ver=1775014292","caption":"Bilal"},"logo":{"@id":"https:\/\/esp32tutorials.com\/wp-content\/litespeed\/avatar\/b623b0da24dec30042f1540f5437f129.jpg?ver=1775014292"},"description":"We are a team of experienced Embedded Software Developers with skills in developing Embedded Linux, RTOS, and IoT products from scratch to deployment with a demonstrated history of working in the embedded software industry. Contact us for your projects: admin@esp32tutorials.com","sameAs":["http:\/\/esp32tutorials.com"],"url":"https:\/\/esp32tutorials.com\/author\/esp32tutorialslab\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/esp32tutorials.com\/wp-json\/wp\/v2\/posts\/814","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/esp32tutorials.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/esp32tutorials.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/esp32tutorials.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/esp32tutorials.com\/wp-json\/wp\/v2\/comments?post=814"}],"version-history":[{"count":0,"href":"https:\/\/esp32tutorials.com\/wp-json\/wp\/v2\/posts\/814\/revisions"}],"wp:attachment":[{"href":"https:\/\/esp32tutorials.com\/wp-json\/wp\/v2\/media?parent=814"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/esp32tutorials.com\/wp-json\/wp\/v2\/categories?post=814"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/esp32tutorials.com\/wp-json\/wp\/v2\/tags?post=814"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}