OLED display

OLED displayI. Learning ObjectivesII. Preparation before the experimentIII. Installing dependent librariesAdafruit_SSD1306 libraryIV. OLED Display System Information1. OLED display2. Access to system information3. Run the oled.py fileV. Experimental phenomena

I. Learning Objectives

Use OLED to display system information such as CPU usage, system time, and memory usage, etc. This tutorial mainly focuses on understanding how to run the oled.py file that we have written, and does not analyse the specific implementation principles and code.

II. Preparation before the experiment

Follow the assembly video tutorial to install the Jetson CUBE Nano chassis, you can also refer to the "Jetson CUBE Nano Chassis_Hardware Wiring" tutorial document for installation, here to show the chassis expansion board and OLED hardware connection.

image-20230715204505212

Chassis Expansion Board3.3VSDASCLNCGNDNC
OLED screen3.3VSDASCLNCGNDNC

III. Installing dependent libraries

Adafruit_SSD1306 library

Note: If you installed the Adafruit_SSD1306 library in the "Installing the CubeNano Driver Library" tutorial, you can skip this step!

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

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

NOTE: If the OLED display tutorial suggests that the PIL library is missing, the following solution can be taken.

IV. OLED Display System Information

1. OLED display

functionalityimplementing function
OLED Initialisebegin()
OLED cleared displayclear()
OLED add charactersadd_text(start_x, start_y, text, refresh)
OLED increases rowsadd_line(text, line, refresh)
OLED refresh displayrefresh()

2. Access to system information

functionalityimplementing function
Read CPU usagegetCPULoadRate()
Read system timegetSystemTime()
Read memory footprint and total memorygetUsagedRAM()
Read TF Card Space Occupancy/Total TF Card SpacegetUsagedDisk()
Get local IPgetLocalIP()
Read free TF card space/total TF card spacegetFreeDisk()

3. Run the oled.py file

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

image-20230717210026176

Note: To terminate the run, you can press Ctrl + Z.

V. Experimental phenomena

After running the oled.py file, you can see the OLED display related system information display (if you want to clear the OLED display, you can see the back of the "set boot" tutorial, run kill_oled.sh file).

image-20230717210150488