yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
CUBE Pi Case📖
1. Assembly tutorial
  • 1. Installation video
  • 3. Hardware wiring instructions
2. CUBE Pi interface description and precautions
  • CUBE Pi interface description and precautions
3. Chassis driver tutorial
4. RGB light strip driver
  • RGB light strip driver
3. Fan drive
  • Fan drive
2. OLED display
  • OLED display
1. Install driver library
  • Install driver library
5. Set up auto-startup
  • Set up auto-startup
6. M.2 expansion board information (optional)
  • Installation steps
  • System Mount
Download
  • Code
  • System_Image_File
  • Communication Protocol
  • Instruction_Manual
Download ZIP

Welcome to CUBE Pi Case repository

当製品の日本語版マニュアル資料は、こちらからご取得ください。

OLED display

OLED display

OLED display1. Learning objectives2. Preparation before the experiment3. Install dependent librariesAdafruit_SSD1306 library4. OLED displays system information1. OLED display2. System information acquisition3. Run oled.py file5. Experimental phenomenon

1. Learning objectives

  • Implement OLED display system information

Use OLED to display system information such as CPU usage, system time, and memory usage. This tutorial mainly learns how to run the oled.py file we wrote. The specific implementation principle and code are not analyzed.

2. Preparation before the experiment

Install the Raspberry Pi chassis according to the assembly video tutorial, and align the oled board with the 40pin pin of the Raspberry Pi.

3. Install dependent libraries

Adafruit_SSD1306 library

Note: If the Adafruit_SSD1306 library is installed in the "Install CubeNano driver library" tutorial, you can skip this step!

The Adafruit_SSD1306 library is a dependent library required in the oled.py file. Enter the following command in the terminal to install the Adafruit_SSD1306 library.

xxxxxxxxxx
pip3 install Adafruit_SSD1306 --break-system-packages

The python Adafruit_SSD1306 library is used to control the data display of our OLED display.

Note: If the PIL library is missing in the OLED display tutorial, you can take the following solution. ** (generally not required to run)**

xxxxxxxxxx
sudo apt-get install libjpeg-dev zlib1g-dev
pip3 install setuptools --break-system-packages
pip3 install Pillow --break-system-packages

4. OLED displays system information

1. OLED display

FunctionImplementation function
OLED initializationbegin()
OLED clear displayclear()
OLED add charactersadd_text(start_x, start_y, text, refresh)
OLED add linesadd_line(text, line, refresh)
OLED refresh displayrefresh()

2. System information acquisition

FunctionImplementation function
Read CPU usagegetCPULoadRate()
Read system timegetSystemTime()
Read memory usage and total memorygetUsagedRAM()
Read TF card space usage/TF card total spacegetUsagedDisk()
Get local IPgetLocalIP()
Read free TF card space/TF card total spacegetFreeDisk()

3. Run oled.py file

Copy the oled.py file in the data to the Jetson motherboard system, open the terminal in the directory where the oled.py file is located, and use the following command to run the oled.py file.

xxxxxxxxxx
python3 oled.py

image-20230717210026176

Note: You can press Ctrl + C twice in a row to terminate the operation

5. Experimental phenomenon

After running the oled.py file, you can see the display of system information related to the OLED display (to clear the OLED display, see the "Setting the boot-up auto-start" tutorial later and run the kill_oled.sh file). image-20230717210026145

Fan drive
Install driver library

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文