Template: 0.91inch-OLED-Module-STM32-Guides

From Waveshare Wiki
Revision as of 12:33, 4 January 2022 by Eng35 (talk | contribs) (Created page with "==Hardware Coonnection== The examples are based on STM32F103RBT6 as well as the connection table. If you want to use other MCU, you need to port the project and change the con...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Hardware Coonnection

The examples are based on STM32F103RBT6 as well as the connection table. If you want to use other MCU, you need to port the project and change the connection according to the actual hardware.

Connect to STM32F103RBT6
OLED STM32
VCC 3.3V
GND GND
SDA I2C:PB9 / I2C_SOFT:PC8
SCL I2C:PB8 / I2C_SOFT:PC6
  • I2C Hardware connection

0.91-OLED-STM32.jpg

Run the demo

  • Download the demo, find the STM32 demo file directory, use Keil5 to open oled_demo.uvprojx in the \STM32\STM32-F103RBT6\MDK-ARM directory.
  • Then modify the corresponding function comment in main.c according to the LCD model you are using, and then recompile and download to your board.
OLED STM32 code0.png
  • For examples, if you are using 1.3inch OLED Module (C),you need to comment out the line 105. (Note: there cannot be multiple sentences without comment at the same time; the line number may be changed, please modify it according to the actual situation)
  • The demo folder of each LCD model can fine in the following table:
LCD Model Demo function
0.91inch OLED Module
OLED_0in91_test();
0.95inch RGB OLED (A)/(B)
OLED_0in95_rgb_test();
0.96inch OLED (A)/(B)
OLED_0in96_test();
1.3inch OLED (A)/(B)
OLED_1in3_test();
1.3inch OLED Module (C)
OLED_1in3_c_test();
1.5inch OLED Module
OLED_1in5_test();
1.5inch RGB OLED Module
OLED_1in5_rgb_test();

Software description

  • The demo is developed based on the HAL library. Download the demo, find the STM32 program file directory, and open the oled_demo.uvprojx in the STM32\STM32F103RBT6\MDK-ARM directory to check the program.
OLED STM32 code1.png
  • In addition, you can see the file directory of the project in the STM32\STM32-F103RBT6\User\ directory. The five folders are the underlying driver, sample program, font, GUI, and OLED driver.
OLED STM32 code2.png