5.4 Use of onboard OLED screen

Note: In the image operating system provided by Yahboom, the APP remote control process is enabled by default, in order to avoid multiple occupations of internal resources, causing some functions to fail to operate normally.

Before you running the code of this course, please follow the following to close the APP remote control process.

If you want to permanently close the function of the APP control process that starts automatically after booting, execute the following command:

If you want to permanently open the function of the APP control process that starts automatically after booting, execute the following command:

If you do not restart Jetbotmini to restart the APP function, execute the following command:

5.4.1 Introduction to onboard OLED screen driver

The onboard OLED screen uses the Adafruit_Python_SSD1306 driver. As the name implies, the driver name of the OLED screen is called SSD1306. This is a very common OLED driver. If you are interested, you can see [JetBot-Mini-Robot-Car] --> [Annex]- -> [JetBot-Mini Dependency package]---> [Adafruit_Python_SSD1306]--> [Adafruit_SSD1306]--> [SSD1306.py], we can see the OLED I2C peripheral address is 0x3C, which is stored Regarding all methods and register information for driving the screen, the screen we use is a model with a resolution of 128*32. The information it can display is enough to provide us with the information we need to know about the use of Jetbotmini. For the specific display content, we see the use below introduce.

5.4.2 Display IP address, system, memory usage information on the I2C screen

image-20211022152647214

As shown in the figure above, the Jetbotmini usage information interface displayed by OLED, the displayed contents are as follows:

1. The first line of content: the IP address information of the wired network

2. The second line of content: the IP address information of the WIFI wireless network

3. The third line of content: running memory usage and percentage of running memory used

4. The fourth line of content: Disk memory usage and the percentage of used disk memory

The Jetbotmini system has enabled the process of OLED real-time refresh display by default. In this course, we need to display the battery voltage in real time through OLED. The same IIC device used by the above two processes.

In order to avoid conflicts between them, we need to close the process of OLED real-time refresh display before running the code of this course.

After running above command, we can observe that there is no value refresh display on the screen, then let's run the code we want to test:

First we import the modules we need to use

Then we create the SSD1306 object instance we need to use and create the variables that we need to use. When creating the OLED object instance, we will automatically call the driver initialization function to initialize the OLED screen. For the specific content, we can see the following code unit Notes in the box:

After running the above code, we find that the display content on the OLED screen is now cleared, which means that our code has initialized the OLED screen, and then we run the following cell code to start real-time collection of Jetbotmini every one second The usage data is refreshed to the onboard OLED display.

After running the above code, the current usage information of Jetbotmini will be displayed on the OLED display immediately.

The corresponding complete source code is located:

/home/jetson/Notebooks/English/5.Use_of_OLED/Use_of_OLED.ipynb