Data Sheet

1.5inch OLED Module User Manual
RST
25 (BCM)
2. Enable communication interfaces of Pi
sudo raspi-config
If you use SPI interface (by default):
Choose Interface Options -> SPI -> yes to enable the SPI
If you use I2C interfae:
Choose Interface Options -> I2C -> yes to enable I2C
3. Libraries installation
About how to install libraries for Raspberry Pi code, please visit this page:
Libraries_Installation_for_RPi. The wiki page describe about how to install libraries for BCM2835,
WiringPi and Python.
4. Using
Copy the Raspberry Pi sample codes to your Raspberry Pi (you can use samba or directly
copy to the boot folder of SD card). The codes we describe below are all be copy to the user
directory of pi.
4.1 BM2835
Execute command ls:
bin: Include the .o files
Fonts: Include five fonts files
Obj: Object files are contained
main.c: main functions file
DEV_Config.c: defines the GPIOs of Pi and the communication type. If you have changed
the communication mode followed the Hardware Configuration above, you just need to modify
the USE_SPI_4W and USE_IIC macros in the header file.
OLED_Driver.c: drive codes of OLED
OLED_GUI.c: functions of drawing and displaying.
Makefile: make file of project. If you have changed the codes, you need to execute
command make clear to delete the dependent files and executable files which generated
before. Then execute make to generate new files.
oled_1in5: Executable file, generated by command make.
You can run the sample code by command: sudo ./oled_1in5
4.2 WiringPi
Execute command ls:
The folder catalog of WiringPi is same as BCM2835. Their difference are that: