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
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.
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.
Chassis Expansion Board | 3.3V | SDA | SCL | NC | GND | NC |
---|---|---|---|---|---|---|
OLED screen | 3.3V | SDA | SCL | NC | GND | NC |
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.
xxxxxxxxxx
pip3 install Adafruit_SSD1306
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.
xxxxxxxxxx
sudo apt-get install libjpeg-dev zlib1g-dev
pip3 install setuptools
pip3 install Pillow
functionality | implementing function |
---|---|
OLED Initialise | begin() |
OLED cleared display | clear() |
OLED add characters | add_text(start_x, start_y, text, refresh) |
OLED increases rows | add_line(text, line, refresh) |
OLED refresh display | refresh() |
functionality | implementing function |
---|---|
Read CPU usage | getCPULoadRate() |
Read system time | getSystemTime() |
Read memory footprint and total memory | getUsagedRAM() |
Read TF Card Space Occupancy/Total TF Card Space | getUsagedDisk() |
Get local IP | getLocalIP() |
Read free TF card space/total TF card space | getFreeDisk() |
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.
xxxxxxxxxx
python3 oled.py
Note: To terminate the run, you can press Ctrl + Z.
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).