---
title: "W55RP20-EVB-PICO ssd1306 example"
url: "https://maker.wiznet.io/josephsr/projects/w55rp20-evb-pico-ssd1306-example/"
markdown_url: "https://maker.wiznet.io/josephsr/projects/w55rp20-evb-pico-ssd1306-example/md"
type: "WCC: WIZnet Created Content"
author: "Joseph"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "Joseph"
license: "MIT license (MIT)"
published: "2024-11-11"
language: "en"
tags: ["LCD"]
hardware: ["WIZnet W55RP20-EVB-Pico", "various company ssd1306"]
likes: 0
views: 1231
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# W55RP20-EVB-PICO ssd1306 example

> This example uses MicroPython to control an SSD1306 OLED over I2C. It draws shapes and displays text, with adjustable update frequency for balanced performance.

Original author: Joseph

## Components

- **WIZnet W55RP20-EVB-Pico** x 1 ([docs](https://wiznet.io/products/powered-by-raspberry-pi/w55rp20-evb-pico))
- **various company ssd1306** x 1
- Software: **MicroPython** ([docs](http://micropython.org/))

## Documents and links

- [ssd1306 test](https://github.com/WIZnet-ioNIC/WIZnet-ioNIC-micropython/blob/master/WIZnet-ioNIC_examples/ssd1306_test.py) (code)
- [micropython adafruit ssd1306 library](https://github.com/adafruit/micropython-adafruit-ssd1306) (code)

## Article

### Environment Used

- **Hardware**: Used with an embedded device like Raspberry Pi.

- **Display**: SSD1306 OLED display module (I2C interface).

- **Processor**: ARM-based microcontroller.

- **Programming Language**: MicroPython.

- **Other Components**: GPIO pins supporting I2C communication (SCL = Pin 9, SDA = Pin 8).

### Technologies Used

1. **MicroPython and Machine Module**: This library allows direct communication with hardware, setting up GPIO pins, and managing I2C communication.

2. **SSD1306 Library**: Used to communicate with the SSD1306 display over I2C, displaying text and drawing various shapes.

3. **OOP Approach**: Managed the OLED display in an object-oriented manner by creating an instance of the `OLED_Display` class.

4. **Performance Optimization**: Optimized performance using `pixel_threshold` and `show_delay` to control the frequency of screen updates.

### How to Use

**Initialization**:

- Initialize the display module using the `OLED_Display()` class.

- Set up the connection with the SSD1306 display using I2C.

**Display Text**:

- Call `print_oled(text)` to display text at a specific position.

- After displaying, the Y-coordinate automatically updates to prepare for the next line of text.

**Drawing Shapes**:

- Use `draw_shapes(show_delay)` or `draw_shape(shape, show_delay)` to draw different shapes like rectangles, circles, and triangles on the OLED screen.

- `show_delay` parameter allows you to control the delay during drawing, which can be useful for adjusting the drawing speed.

**Performance Tuning**:

- The `pixel_threshold` value determines how frequently the `oled.show()` function is called after updating pixels.

- `show_delay` controls the delay between pixel rendering, allowing fine-tuned control over rendering performance.

**Test**:

- detailed pinmap of w55rp20 - <https://docs.wiznet.io/Product/ioNIC/W55RP20/overview>

- w55rp20 datasheet - refere attached in the link below.

- jumper cable connection:
  - w55rp2040's **GP9** to ssd1306's **SCL**
  - w55rp2040's **GP8** to ssd1306's **SDA**
  - w55rp2040's 3V3 to ssd1306's **VCC**
  - w55rp2040's GND to ssd1306's **GND**
  - ![](https://maker.wiznet.io/upload/ckeditor5/254958284%5F1731406533%2Ejpeg)![](https://maker.wiznet.io/upload/ckeditor5/254958284%5F1731406574%2Ejpeg)

- Install the MicroPython uf2 binary provided by wiznet (https://github.com/WIZnet-ioNIC/WIZnet-ioNIC-micropython/releases) in boot mode.(please refer this link for detailed installation instructions:[W55RP20-EVB-PICO Redis example](https://maker.wiznet.io/josephsr/projects/w55rp20%2Devb%2Dpico%2Dredis%2Dexample/), ) Then, in Thonny, add ssd1306.py and ssd1306_test.py files. You can verify the operation by running the ssd1306_test.py file.

- ![](https://maker.wiznet.io/upload/ckeditor5/254958284%5F1731407233%2Egif)

**Reference**:

- [W55RP20_ds_v010e.pdf](https://docs.wiznet.io/img/products/w55rp20/W55RP20_ds_v010e.pdf)

- [adafruit/micropython-adafruit-ssd1306: MicroPython driver for SSD1306 OLED displays.](https://github.com/adafruit/micropython-adafruit-ssd1306)

- [SSD1306 description post in Korean](https://blog.naver.com/PostView.nhn?blogId=emperonics&logNo=222081054316)

- ssd1306 like product in [aliexpress](https://ko.aliexpress.com/item/32896205376.html?src=google&pdp_npi=4%40dis%21KRW%211666%211450%21%21%21%21%21%40%2112000037978067553%21ppc%21%21%21&src=google&albch=shopping&acnt=298-731-3000&isdl=y&slnk=&plac=&mtctp=&albbt=Google_7_shopping&aff_platform=google&aff_short_key=UneMJZVf&gclsrc=aw.ds&&albagn=888888&&ds_e_adid=&ds_e_matchtype=&ds_e_device=c&ds_e_network=x&ds_e_product_group_id=&ds_e_product_id=ko32896205376&ds_e_product_merchant_id=108988894&ds_e_product_country=KR&ds_e_product_language=ko&ds_e_product_channel=online&ds_e_product_store_id=&ds_url_v=2&albcp=21642794340&albag=&isSmbAutoCall=false&needSmbHouyi=false&gad_source=4&gclid=Cj0KCQiA88a5BhDPARIsAFj595jvj7--kqgO1yaScYMAsXSjb8Ooc1BHunS-1-b1YXwF4H43hLZc9YIaAjVjEALw_wcB)

---

Source: https://maker.wiznet.io/josephsr/projects/w55rp20-evb-pico-ssd1306-example/
