{"id":85564,"date":"2019-05-23T10:34:18","date_gmt":"2019-05-23T10:34:18","guid":{"rendered":"https:\/\/randomnerdtutorials.com\/?p=85564"},"modified":"2023-07-05T13:36:18","modified_gmt":"2023-07-05T13:36:18","slug":"micropython-oled-display-esp32-esp8266","status":"publish","type":"post","link":"https:\/\/randomnerdtutorials.com\/micropython-oled-display-esp32-esp8266\/","title":{"rendered":"MicroPython: OLED Display with ESP32 and ESP8266"},"content":{"rendered":"\n<p>In this guide, you&#8217;ll learn how to use the 0.96 inch SSD1306 OLED display with an ESP32 or ESP8266 using MicroPython firmware. As an example, we\u2019ll show you how to display a simple &#8216;Hello, World!&#8217; message. Later, we\u2019ll also show you how to use other useful functions to interact with the OLED display.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" width=\"1200\" height=\"675\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/oled-esp8266-esp32-micropython.jpg?resize=1200%2C675&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"oled display esp8266 esp32 micropython\" class=\"wp-image-85574\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/oled-esp8266-esp32-micropython.jpg?w=1280&amp;quality=100&amp;strip=all&amp;ssl=1 1280w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/oled-esp8266-esp32-micropython.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/oled-esp8266-esp32-micropython.jpg?resize=768%2C432&amp;quality=100&amp;strip=all&amp;ssl=1 768w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/oled-esp8266-esp32-micropython.jpg?resize=1024%2C576&amp;quality=100&amp;strip=all&amp;ssl=1 1024w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure><\/div>\n\n\n<p>You might also like reading our dedicated guides for ESP with OLED display using Arduino IDE:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/randomnerdtutorials.com\/esp32-ssd1306-oled-display-arduino-ide\/\">ESP32 OLED Display with Arduino IDE<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/esp8266-0-96-inch-oled-display-with-arduino-ide\/\">ESP8266 OLED Display with Arduino IDE<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p>To follow this tutorial you need MicroPython firmware installed in your ESP32 or ESP8266 boards. You also need an IDE to write and upload the code to your board. We suggest using Thonny IDE or uPyCraft IDE:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Thonny IDE:\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/randomnerdtutorials.com\/getting-started-thonny-micropython-python-ide-esp32-esp8266\/\">Installing and getting started with Thonny IDE<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/flashing-micropython-firmware-esptool-py-esp32-esp8266\/\">Flashing MicroPython Firmware with esptool.py<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>uPyCraft IDE:\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/randomnerdtutorials.com\/getting-started-micropython-esp32-esp8266\/\">Getting Started with uPyCraft IDE<\/a><\/li>\n\n\n\n<li>Install uPyCraft IDE (<a href=\"https:\/\/randomnerdtutorials.com\/install-upycraft-ide-windows-pc-instructions\/\">Windows<\/a>,&nbsp;<a href=\"https:\/\/randomnerdtutorials.com\/install-upycraft-ide-mac-os-x-instructions\/\">Mac OS X<\/a>,&nbsp;<a href=\"https:\/\/randomnerdtutorials.com\/install-upycraft-ide-linux-ubuntu-instructions\/\">Linux<\/a>)<\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/flash-upload-micropython-firmware-esp32-esp8266\/\">Flash\/Upload MicroPython Firmware to ESP32 and ESP8266<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p class=\"rntbox rntclblue\">Learn more about MicroPython:&nbsp;<a href=\"https:\/\/randomnerdtutorials.com\/micropython-programming-with-esp32-and-esp8266\/\">MicroPython Programming with ESP32 and ESP8266 eBook<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Introducing the OLED display<\/h2>\n\n\n\n<p>In this guide we\u2019ll use the <a href=\"https:\/\/makeradvisor.com\/tools\/oled-display-128x64-0-96-inch\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">0.96 inch SSD1306 OLED display<\/a> that is 128&#215;64 pixels and uses I2C communication protocol.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"750\" height=\"412\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2016\/09\/ssd1306-oled-display-arduino.jpg?resize=750%2C412&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ssd1306 0.96inch i2c oled display\" class=\"wp-image-80990\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2016\/09\/ssd1306-oled-display-arduino.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2016\/09\/ssd1306-oled-display-arduino.jpg?resize=300%2C165&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\">I2C communication<\/h3>\n\n\n\n<p>For the I2C OLED display, these are the connections you need to make:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>OLED<\/strong><\/td><td><strong>ESP32<\/strong><\/td><td><strong>ESP8266<\/strong><\/td><\/tr><tr><td>Vin<\/td><td><span class=\"rnthl rntcred\">3.3V<\/span><\/td><td><span class=\"rnthl rntcred\">3.3V<\/span><\/td><\/tr><tr><td>GND<\/td><td><span class=\"rnthl rntcblack\">GND<\/span><\/td><td><span class=\"rnthl rntcblack\">GND<\/span><\/td><\/tr><tr><td>SCL<\/td><td><span class=\"rnthl rntclgray\">GPIO 22<\/span><\/td><td><span class=\"rnthl rntclgray\">GPIO 5<\/span> (D1) <\/td><\/tr><tr><td>SDA<\/td><td><span class=\"rnthl rntcyellow\">GPIO 21<\/span><\/td><td><span class=\"rnthl rntcyellow\">GPIO 4<\/span> (D2) <\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Parts Required<\/h2>\n\n\n\n<p>Here\u2019s a list of parts you need for this project:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/makeradvisor.com\/tools\/oled-display-128x64-0-96-inch\/\" target=\"_blank\">0.96 inch OLED display&nbsp;<\/a><\/li>\n\n\n\n<li><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/makeradvisor.com\/tools\/esp32-dev-board-wi-fi-bluetooth\/\" target=\"_blank\">ESP32<\/a>&nbsp;or&nbsp;<a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/makeradvisor.com\/tools\/esp8266-esp-12e-nodemcu-wi-fi-development-board\/\" target=\"_blank\">ESP8266<\/a>&nbsp;(read&nbsp;<a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/makeradvisor.com\/esp32-vs-esp8266\/\" target=\"_blank\">ESP32 vs ESP8266<\/a>)<\/li>\n\n\n\n<li><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/makeradvisor.com\/tools\/mb-102-solderless-breadboard-830-points\/\" target=\"_blank\">Breadboard<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/makeradvisor.com\/tools\/jumper-wires-kit-120-pieces\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">Jumper wires<\/a><\/li>\n<\/ul>\n\n\n<p>You can use the preceding links or go directly to <a href=\"https:\/\/makeradvisor.com\/tools\/?utm_source=rnt&utm_medium=post&utm_campaign=post\" target=\"_blank\">MakerAdvisor.com\/tools<\/a> to find all the parts for your projects at the best price!<\/p><p style=\"text-align:center;\"><a href=\"https:\/\/makeradvisor.com\/tools\/?utm_source=rnt&utm_medium=post&utm_campaign=post\" target=\"_blank\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/10\/header-200.png?w=1200&#038;quality=100&#038;strip=all&#038;ssl=1\"><\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Schematic &#8211; ESP32<\/h2>\n\n\n\n<p>Follow the next schematic diagram if you\u2019re using an ESP32 board:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/ESP32_OLED.png?quality=100&#038;strip=all&#038;ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"873\" height=\"685\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/ESP32_OLED.png?resize=873%2C685&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"oled display with esp32 micropython\" class=\"wp-image-85566\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/ESP32_OLED.png?w=873&amp;quality=100&amp;strip=all&amp;ssl=1 873w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/ESP32_OLED.png?resize=300%2C235&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/ESP32_OLED.png?resize=768%2C603&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 873px) 100vw, 873px\" \/><\/a><\/figure><\/div>\n\n\n<p class=\"rntbox rntclblue\"><strong>Recommended reading:<\/strong> <a href=\"https:\/\/randomnerdtutorials.com\/esp32-pinout-reference-gpios\/\">ESP32 Pinout Reference Guide<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Schematic &#8211; ESP8266<\/h2>\n\n\n\n<p>Follow the next schematic diagram if you\u2019re using an ESP8266 board:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/es8266-oled_bb-1.png?quality=100&#038;strip=all&#038;ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"828\" height=\"534\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/es8266-oled_bb-1.png?resize=828%2C534&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"esp8266 oled display micropython\" class=\"wp-image-85567\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/es8266-oled_bb-1.png?w=828&amp;quality=100&amp;strip=all&amp;ssl=1 828w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/es8266-oled_bb-1.png?resize=300%2C193&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/es8266-oled_bb-1.png?resize=768%2C495&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 828px) 100vw, 828px\" \/><\/a><\/figure><\/div>\n\n\n<p class=\"rntbox rntclblue\"><strong>Recommended reading:<\/strong> <a href=\"https:\/\/randomnerdtutorials.com\/esp8266-pinout-reference-gpios\/\">ESP8266 Pinout Reference Guide<\/a> <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">SSD1306 OLED Library<\/h2>\n\n\n\n<p>The library to write to the OLED display isn\u2019t part of the standard MicroPython library by default. So, you need to upload the library to your ESP32\/ESP8266 board.<\/p>\n\n\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-python\"># MicroPython SSD1306 OLED driver, I2C and SPI interfaces created by Adafruit\n\nimport time\nimport framebuf\n\n# register definitions\nSET_CONTRAST        = const(0x81)\nSET_ENTIRE_ON       = const(0xa4)\nSET_NORM_INV        = const(0xa6)\nSET_DISP            = const(0xae)\nSET_MEM_ADDR        = const(0x20)\nSET_COL_ADDR        = const(0x21)\nSET_PAGE_ADDR       = const(0x22)\nSET_DISP_START_LINE = const(0x40)\nSET_SEG_REMAP       = const(0xa0)\nSET_MUX_RATIO       = const(0xa8)\nSET_COM_OUT_DIR     = const(0xc0)\nSET_DISP_OFFSET     = const(0xd3)\nSET_COM_PIN_CFG     = const(0xda)\nSET_DISP_CLK_DIV    = const(0xd5)\nSET_PRECHARGE       = const(0xd9)\nSET_VCOM_DESEL      = const(0xdb)\nSET_CHARGE_PUMP     = const(0x8d)\n\n\nclass SSD1306:\n    def __init__(self, width, height, external_vcc):\n        self.width = width\n        self.height = height\n        self.external_vcc = external_vcc\n        self.pages = self.height \/\/ 8\n        # Note the subclass must initialize self.framebuf to a framebuffer.\n        # This is necessary because the underlying data buffer is different\n        # between I2C and SPI implementations (I2C needs an extra byte).\n        self.poweron()\n        self.init_display()\n\n    def init_display(self):\n        for cmd in (\n            SET_DISP | 0x00, # off\n            # address setting\n            SET_MEM_ADDR, 0x00, # horizontal\n            # resolution and layout\n            SET_DISP_START_LINE | 0x00,\n            SET_SEG_REMAP | 0x01, # column addr 127 mapped to SEG0\n            SET_MUX_RATIO, self.height - 1,\n            SET_COM_OUT_DIR | 0x08, # scan from COM[N] to COM0\n            SET_DISP_OFFSET, 0x00,\n            SET_COM_PIN_CFG, 0x02 if self.height == 32 else 0x12,\n            # timing and driving scheme\n            SET_DISP_CLK_DIV, 0x80,\n            SET_PRECHARGE, 0x22 if self.external_vcc else 0xf1,\n            SET_VCOM_DESEL, 0x30, # 0.83*Vcc\n            # display\n            SET_CONTRAST, 0xff, # maximum\n            SET_ENTIRE_ON, # output follows RAM contents\n            SET_NORM_INV, # not inverted\n            # charge pump\n            SET_CHARGE_PUMP, 0x10 if self.external_vcc else 0x14,\n            SET_DISP | 0x01): # on\n            self.write_cmd(cmd)\n        self.fill(0)\n        self.show()\n\n    def poweroff(self):\n        self.write_cmd(SET_DISP | 0x00)\n\n    def contrast(self, contrast):\n        self.write_cmd(SET_CONTRAST)\n        self.write_cmd(contrast)\n\n    def invert(self, invert):\n        self.write_cmd(SET_NORM_INV | (invert &amp; 1))\n\n    def show(self):\n        x0 = 0\n        x1 = self.width - 1\n        if self.width == 64:\n            # displays with width of 64 pixels are shifted by 32\n            x0 += 32\n            x1 += 32\n        self.write_cmd(SET_COL_ADDR)\n        self.write_cmd(x0)\n        self.write_cmd(x1)\n        self.write_cmd(SET_PAGE_ADDR)\n        self.write_cmd(0)\n        self.write_cmd(self.pages - 1)\n        self.write_framebuf()\n\n    def fill(self, col):\n        self.framebuf.fill(col)\n\n    def pixel(self, x, y, col):\n        self.framebuf.pixel(x, y, col)\n\n    def scroll(self, dx, dy):\n        self.framebuf.scroll(dx, dy)\n\n    def text(self, string, x, y, col=1):\n        self.framebuf.text(string, x, y, col)\n\n\nclass SSD1306_I2C(SSD1306):\n    def __init__(self, width, height, i2c, addr=0x3c, external_vcc=False):\n        self.i2c = i2c\n        self.addr = addr\n        self.temp = bytearray(2)\n        # Add an extra byte to the data buffer to hold an I2C data\/command byte\n        # to use hardware-compatible I2C transactions.  A memoryview of the\n        # buffer is used to mask this byte from the framebuffer operations\n        # (without a major memory hit as memoryview doesn't copy to a separate\n        # buffer).\n        self.buffer = bytearray(((height \/\/ 8) * width) + 1)\n        self.buffer[0] = 0x40  # Set first byte of data buffer to Co=0, D\/C=1\n        self.framebuf = framebuf.FrameBuffer1(memoryview(self.buffer)[1:], width, height)\n        super().__init__(width, height, external_vcc)\n\n    def write_cmd(self, cmd):\n        self.temp[0] = 0x80 # Co=1, D\/C#=0\n        self.temp[1] = cmd\n        self.i2c.writeto(self.addr, self.temp)\n\n    def write_framebuf(self):\n        # Blast out the frame buffer using a single I2C transaction to support\n        # hardware I2C interfaces.\n        self.i2c.writeto(self.addr, self.buffer)\n\n    def poweron(self):\n        pass\n\n\nclass SSD1306_SPI(SSD1306):\n    def __init__(self, width, height, spi, dc, res, cs, external_vcc=False):\n        self.rate = 10 * 1024 * 1024\n        dc.init(dc.OUT, value=0)\n        res.init(res.OUT, value=0)\n        cs.init(cs.OUT, value=1)\n        self.spi = spi\n        self.dc = dc\n        self.res = res\n        self.cs = cs\n        self.buffer = bytearray((height \/\/ 8) * width)\n        self.framebuf = framebuf.FrameBuffer1(self.buffer, width, height)\n        super().__init__(width, height, external_vcc)\n\n    def write_cmd(self, cmd):\n        self.spi.init(baudrate=self.rate, polarity=0, phase=0)\n        self.cs.high()\n        self.dc.low()\n        self.cs.low()\n        self.spi.write(bytearray([cmd]))\n        self.cs.high()\n\n    def write_framebuf(self):\n        self.spi.init(baudrate=self.rate, polarity=0, phase=0)\n        self.cs.high()\n        self.dc.high()\n        self.cs.low()\n        self.spi.write(self.buffer)\n        self.cs.high()\n\n    def poweron(self):\n        self.res.high()\n        time.sleep_ms(1)\n        self.res.low()\n        time.sleep_ms(10)\n        self.res.high()\n<\/code><\/pre>\n\t<p style=\"text-align:center\"><a class=\"rntwhite\" href=\"https:\/\/github.com\/RuiSantosdotme\/ESP-MicroPython\/raw\/master\/code\/Others\/OLED\/ssd1306.py\" target=\"_blank\">View raw code<\/a><\/p>\n\n\n\n<p>Follow the next set of instructions for the IDE you&#8217;re using:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A. Upload OLED library with <strong>uPyCraft IDE<\/strong><\/li>\n\n\n\n<li>B. Upload OLED library with <strong>Thonny IDE<\/strong><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">A. Upload OLED library with uPyCraft IDE<\/h3>\n\n\n\n<p>This section shows how to upload a library using uPyCraft IDE. If you&#8217;re using Thonny IDE, read the next section.<\/p>\n\n\n\n<p><strong>1.<\/strong> Create a new file by pressing the <strong>New File<\/strong> button.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"135\" height=\"41\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/10\/uPycraft-ide-tools-menu-new-file.png?resize=135%2C41&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-75063\"\/><\/figure><\/div>\n\n\n<p><strong>2.<\/strong> Copy the OLED library code into that file. The <a href=\"https:\/\/raw.githubusercontent.com\/RuiSantosdotme\/ESP-MicroPython\/master\/code\/Others\/OLED\/ssd1306.py\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">OLED library code can be found here<\/a>.<\/p>\n\n\n\n<p><strong>Note:<\/strong> the SSD1306 OLED display library was built by Adafruit and will no longer<br>be updated. At the moment, it works fine. However, we\u2019ll update this guide if we<br>find a similar library that works as well as this one.<\/p>\n\n\n\n<p><strong>3.<\/strong> After copying the code, save the file by pressing the <strong>Save <\/strong>button.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"142\" height=\"47\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/10\/uPycraft-ide-tools-menu-save-file.png?resize=142%2C47&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-75064\"\/><\/figure><\/div>\n\n\n<p><strong>4.<\/strong> Call this new file \u201c<strong>ssd1306.py<\/strong>\u201d and press <strong>ok<\/strong>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"784\" height=\"704\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/install_ssd1306.png?resize=784%2C704&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"import library upycraft ide save file\" class=\"wp-image-85579\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/install_ssd1306.png?w=784&amp;quality=100&amp;strip=all&amp;ssl=1 784w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/install_ssd1306.png?resize=300%2C269&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/install_ssd1306.png?resize=768%2C690&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 784px) 100vw, 784px\" \/><\/figure><\/div>\n\n\n<p><strong>5.<\/strong> Click the <strong>Download and Run<\/strong> button.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"41\" height=\"52\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/10\/download-run.png?resize=41%2C52&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-75031\"\/><\/figure><\/div>\n\n\n<p>The file should be saved on the device folder with the name \u201c<strong>ssd1306.py<\/strong>\u201d as<br> highlighted in the following figure.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"783\" height=\"704\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/ssd1306_installed.png?resize=783%2C704&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"import save library uPyCraft IDE script file\" class=\"wp-image-85580\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/ssd1306_installed.png?w=783&amp;quality=100&amp;strip=all&amp;ssl=1 783w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/ssd1306_installed.png?resize=300%2C270&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/ssd1306_installed.png?resize=768%2C691&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 783px) 100vw, 783px\" \/><\/figure><\/div>\n\n\n<p>Now, you can use the library functionalities in your code by importing the library.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">B. Upload OLED library with Thonny IDE <\/h3>\n\n\n\n<p>If you\u2019re using Thonny IDE, follow the next steps:<\/p>\n\n\n\n<p><strong>1.<\/strong> Create a new file in Thonny IDE and copy the library code. The <a aria-label=\" (opens in a new tab)\" href=\"https:\/\/raw.githubusercontent.com\/RuiSantosdotme\/ESP-MicroPython\/master\/code\/Others\/OLED\/ssd1306.py\" target=\"_blank\" rel=\"noreferrer noopener\">OLED library code can be found here<\/a>.<\/p>\n\n\n\n<p><strong>2<\/strong>. Go to <strong>File <\/strong>> <strong>Save <\/strong>as and select <strong>MicroPython device<\/strong>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/01\/save-micropython-device-thonny-ide.png?quality=100&#038;strip=all&#038;ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"220\" height=\"202\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/01\/save-micropython-device-thonny-ide.png?resize=220%2C202&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Thonny IDE Save to MicroPython Device\" class=\"wp-image-109022\"\/><\/a><\/figure><\/div>\n\n\n<p><strong>3.<\/strong> Name the file <em>ssd1306.py<\/em> and click <strong>OK <\/strong>to save the file on the ESP Filesystem.<\/p>\n\n\n\n<p>And that&#8217;s it. The library was uploaded to your board. Now, you can use the library functionalities in your code by importing the library. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Code<\/h2>\n\n\n\n<p>After uploading the library to the ESP32 or ESP8266, copy the following code to the<br><em>main.py<\/em> file. It simply prints the &#8216;<em>Hello, World!<\/em>&#8216; message three times in the display.<\/p>\n\n\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-python\"># Complete project details at https:\/\/RandomNerdTutorials.com\/micropython-programming-with-esp32-and-esp8266\/\n\nfrom machine import Pin, SoftI2C\nimport ssd1306\nfrom time import sleep\n\n# ESP32 Pin assignment \ni2c = SoftI2C(scl=Pin(22), sda=Pin(21))\n\n# ESP8266 Pin assignment\n#i2c = SoftI2C(scl=Pin(5), sda=Pin(4))\n\noled_width = 128\noled_height = 64\noled = ssd1306.SSD1306_I2C(oled_width, oled_height, i2c)\n\noled.text('Hello, World 1!', 0, 0)\noled.text('Hello, World 2!', 0, 10)\noled.text('Hello, World 3!', 0, 20)\n        \noled.show()\n<\/code><\/pre>\n\t<p style=\"text-align:center\"><a class=\"rntwhite\" href=\"https:\/\/github.com\/RuiSantosdotme\/ESP-MicroPython\/raw\/master\/code\/Others\/OLED\/main.py\" target=\"_blank\">View raw code<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How the Code Works<\/h2>\n\n\n\n<p>Start by importing the necessary modules to interact with the GPIOs and send data to the OLED via I2C communication. You need to import the <span class=\"rnthl rntliteral\">Pin<\/span> and <span class=\"rnthl rntliteral\">SoftI2C<\/span> classes from the <span class=\"rnthl rntliteral\">machine<\/span> module.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>from machine import Pin, SoftI2C<\/code><\/pre>\n\n\n\n<p>You also need to import the OLED library that you previously uploaded to the board as <em>ssd1306.py<\/em> file.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>import ssd1306<\/code><\/pre>\n\n\n\n<p>The ESP32 default I2C pins are <span class=\"rnthl rntclgray\">GPIO 22<\/span> (SCL) and <span class=\"rnthl rntcyellow\">GPIO 21<\/span> (SDA). The ESP8266 default I2C pins are <span class=\"rnthl rntclgray\">GPIO 5<\/span> (SLC) and <span class=\"rnthl rntcyellow\">GPIO 4<\/span> (SDA).<\/p>\n\n\n\n<p>Use the following line if you\u2019re using an ESP32 board:<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code># ESP32 Pin assignment \ni2c = SoftI2C(scl=Pin(22), sda=Pin(21))<\/code><\/pre>\n\n\n\n<p>Comment the previous line and uncomment the following if you\u2019re using an ESP8266 board:<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>#ESP8266 Pin assignment\ni2c = SoftI2C(scl=Pin(5), sda=Pin(4))<\/code><\/pre>\n\n\n\n<p> Define the OLED width and height on the following variables:<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>oled_width = 128\noled_height = 64<\/code><\/pre>\n\n\n\n<p>After that, create an <span class=\"rnthl rntliteral\">SSD1306_I2C<\/span> object called <span class=\"rnthl rntliteral\">oled<\/span>. This object accepts the OLED width, height, and the I2C pins you\u2019ve defined earlier.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>oled = ssd1306.SSD1306_I2C(oled_width, oled_height, i2c)<\/code><\/pre>\n\n\n\n<p>After initializing the OLED display, you just need to use the <span class=\"rnthl rntliteral\">text()<\/span> function on the <span class=\"rnthl rntliteral\">oled<\/span> object to write text. After the <span class=\"rnthl rntliteral\">text()<\/span> function, you need to call the <span class=\"rnthl rntliteral\">show()<\/span> method to update the OLED.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>oled.text('Hello, World 1!', 0, 0)\noled.text('Hello, World 2!', 0, 10)\noled.text('Hello, World 3!', 0, 20)\noled.show()<\/code><\/pre>\n\n\n\n<p>The <span class=\"rnthl rntliteral\">text()<\/span> method accepts the following arguments (in this order):<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Message:<\/strong> must be of type String<\/li>\n\n\n\n<li><strong>X position:<\/strong> where the text starts<\/li>\n\n\n\n<li><strong>Y position:<\/strong> where the text is displayed vertically<\/li>\n\n\n\n<li><strong>Text color:<\/strong> it can be either black or white. The default color is white and this parameter is optional.\n<ul class=\"wp-block-list\">\n<li>0 = black<\/li>\n\n\n\n<li>1 = white<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>For example, the following line writes the \u2018Hello, World 1!\u2019 message in white color. The text starts on x = 0 and y = 0. <\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>oled.text('Hello, World 1!', 0, 0)<\/code><\/pre>\n\n\n\n<p> The next line of code writes the text on the next line (y =10).<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>oled.text('Hello, World 2!', 0, 10)<\/code><\/pre>\n\n\n\n<p>Finally, for the changes to take effect, use the <span class=\"rnthl rntliteral\">show()<\/span> method on the <span class=\"rnthl rntliteral\">oled<\/span> object.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>oled.show()<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Demonstration<\/h2>\n\n\n\n<p>Upload the code to your board. Your OLED display should look as follows:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"421\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/ESP32-ESP8266-MicroPython-OLED-Display-Hello-World.jpg?resize=750%2C421&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"oled display text esp8266 esp32 micropython\" class=\"wp-image-85594\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/ESP32-ESP8266-MicroPython-OLED-Display-Hello-World.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/ESP32-ESP8266-MicroPython-OLED-Display-Hello-World.jpg?resize=300%2C168&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">Other OLED functions<\/h2>\n\n\n\n<p>The library provides other methods to interact with the OLED display.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Fill the screen<\/h3>\n\n\n\n<p>To fill the entire screen with white, use the <span class=\"rnthl rntliteral\">fill()<\/span> function as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>oled.fill(1)\noled.show()<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"421\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/ESP32-ESP8266-MicroPython-OLED-Display-White-Screen.jpg?resize=750%2C421&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"oled fill white screen esp8266 esp32 micropython\" class=\"wp-image-85595\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/ESP32-ESP8266-MicroPython-OLED-Display-White-Screen.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/ESP32-ESP8266-MicroPython-OLED-Display-White-Screen.jpg?resize=300%2C168&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<p>To clear the screen use the <span class=\"rnthl rntliteral\">fill()<\/span> method as pass <span class=\"rnthl rntliteral\">0<\/span> as argument. (Sets all pixels to black):<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>oled.fill(0)\noled.show()<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Draw a pixel<\/h3>\n\n\n\n<p>To draw a pixel, use the <span class=\"rnthl rntliteral\">pixel()<\/span> method, followed by the <span class=\"rnthl rntliteral\">show()<\/span> method. The <span class=\"rnthl rntliteral\">pixel()<\/span> method accepts the following arguments:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>X coordinate:<\/strong> pixel location horizontally<\/li>\n\n\n\n<li><strong>Y coordinate:<\/strong> pixel location vertically<\/li>\n\n\n\n<li><strong>Pixel color:<\/strong> can be black or white\n<ul class=\"wp-block-list\">\n<li>0 = black<\/li>\n\n\n\n<li>1 = white<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>For example, to draw a white pixel on the top left corner:<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>oled.pixel(0, 0, 1)\noled.show()<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"421\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/ESP32-ESP8266-MicroPython-OLED-Display-Pixel-Dot.jpg?resize=750%2C421&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"oled display a pixel esp8266 esp32 micropython\" class=\"wp-image-85596\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/ESP32-ESP8266-MicroPython-OLED-Display-Pixel-Dot.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/ESP32-ESP8266-MicroPython-OLED-Display-Pixel-Dot.jpg?resize=300%2C168&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\">Invert colors<\/h3>\n\n\n\n<p>You can also invert the OLED colors:  white with black and vice versa, using the <span class=\"rnthl rntliteral\">invert()<\/span> method:<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>oled.invert(True)<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"421\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/ESP32-ESP8266-MicroPython-OLED-Display-Hello-World-Inverted.jpg?resize=750%2C421&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"oled invert colors esp8266 esp32 micropython\" class=\"wp-image-85597\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/ESP32-ESP8266-MicroPython-OLED-Display-Hello-World-Inverted.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/ESP32-ESP8266-MicroPython-OLED-Display-Hello-World-Inverted.jpg?resize=300%2C168&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<p>To get back to the original colors, use:<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>oled.invert(False)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Displaying data from sensors<\/h2>\n\n\n\n<p>The <span class=\"rnthl rntliteral\">text()<\/span> function only accepts variables of type String as a message. Sensor readings are usually stored in int or float variables. <\/p>\n\n\n\n<p>If you want to display sensor readings and they are stored in int or float variables, they should be converted to a String. To convert the data to a string you can use the <span class=\"rnthl rntliteral\">str()<\/span> function:<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>temperature = 12.34\ntemperature_string = str(temperature)<\/code><\/pre>\n\n\n\n<p>Then, you can display the <span class=\"rnthl rntliteral\">temperature_string<\/span> variable on the OLED using the <span class=\"rnthl rntliteral\">text()<\/span> and <span class=\"rnthl rntliteral\">show()<\/span> methods:<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>oled.text(temperature_string, 0, 0)\noled.show()<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Wrapping Up<\/h2>\n\n\n\n<p>This quick guide showed you how to use the OLED basic functionalities: write text and draw pixels with the ESP32 and ESP8266 using MicroPython. Now, you can use the OLED in your own projects to display messages, or sensor readings.<\/p>\n\n\n\n<p>We have other MicroPython tutorials that you might also like:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/randomnerdtutorials.com\/esp32-esp8266-dht11-dht22-micropython-temperature-humidity-sensor\/\">MicroPython: ESP32\/ESP8266 with DHT11\/DHT22<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/micropython-esp32-esp8266-dht11-dht22-web-server\/\">MicroPython: ESP32\/ESP8266 with DHT11\/DHT22 Web Server<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/micropython-ws2812b-addressable-rgb-leds-neopixel-esp32-esp8266\/\">MicroPython: WS2812B Addressable RGB LEDs with ESP32 and ESP8266<\/a><\/li>\n<\/ul>\n\n\n\n<p>If you want to learn more about programming the ESP32 and ESP8266 boards with MicroPython, take a look our eBook:&nbsp;<a href=\"https:\/\/randomnerdtutorials.com\/micropython-programming-with-esp32-and-esp8266\/\">MicroPython Programming with ESP32 and ESP8266<\/a>. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, you&#8217;ll learn how to use the 0.96 inch SSD1306 OLED display with an ESP32 or ESP8266 using MicroPython firmware. As an example, we\u2019ll show you how to &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"MicroPython: OLED Display with ESP32 and ESP8266\" class=\"read-more button\" href=\"https:\/\/randomnerdtutorials.com\/micropython-oled-display-esp32-esp8266\/#more-85564\" aria-label=\"Read more about MicroPython: OLED Display with ESP32 and ESP8266\">CONTINUE READING \u00bb<\/a><\/p>\n","protected":false},"author":5,"featured_media":85574,"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":[281,265,310,309,264],"tags":[],"class_list":["post-85564","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-esp32-project","category-esp8266-project","category-micropython","category-0-esp32-micropython","category-project"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/oled-esp8266-esp32-micropython.jpg?fit=1280%2C720&quality=100&strip=all&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/85564","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/comments?post=85564"}],"version-history":[{"count":4,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/85564\/revisions"}],"predecessor-version":[{"id":132928,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/85564\/revisions\/132928"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media\/85574"}],"wp:attachment":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media?parent=85564"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/categories?post=85564"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/tags?post=85564"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}