Wiznet makers

josephsr

Published November 11, 2024 © MIT license (MIT)

59 UCC

6 WCC

10 VAR

0 Contests

0 Followers

0 Following

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.

COMPONENTS Hardware components

WIZnet - W55RP20-EVB-Pico

x 1


various company - ssd1306

x 1

Software Apps and online services

micropython - MicroPython

x 1


PROJECT DESCRIPTION

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:

Reference:

Documents
  • ssd1306 test

  • micropython adafruit ssd1306 library

Comments Write