0.96OLED显示屏-模块说明书
0.96寸OLED显示屏用户手册说明书
0.96inch OLEDUser Manual 1.Driver Chip SSD1306Interface 3-wire SPI、4-wire SPI、I2CResolution 128x64Display Size 0.96 inchDimension 29mm*33mmColors Yellow, BlueVisible Angle >160°Operating Temp. (℃) -20℃~70℃Storage Temp. (℃) -30℃~80℃2.We will illustrate the usage of the module with an example of 4-wire SPI mode (defaultworking mode) by connecting Waveshare Open103R development board (STM32V MCU onboard).2.1.Hardware configurationThis module provides 3 kinds of driver interfaces; they are 3-wire SPI, 4-wire SPI and I2C interface. In its factory settings, BS0/BS1 pins are set to 0/0 and 4-wire SPI is selected as default.Different working mode and pin function of the module can be set by hardware selection on BS0/BS1 pins. (Notice: In this operation, welding is required. Any changes under no guidance from Waveshare will be considered as a waiver of warranty).Table 1: Working mode setting122.2.Software configurationOpen the project file .\IDE\ OLED.uvproj in Keil, navigate to the following text, delete the ‘//’ (Double slash) before #define INTERFACE_4WIRE_SPI After compiling successfully, download the project to Open103R development board. Note: You should delete the ‘//’ (Double slash) corresponding to the mode selection2.3. Hardware connectionsConnect module to the SPI2 interface of Open103R development board, power up. OLED displays information as Figure 1 shows.Figure 1: OLED information display3. 4-wire SPI and I2C interfaces of SSD1306 OLEDThis module provides 3 kinds of driver interfaces. We introduce 4-wire SPI and I2C interfaceshere. You can read Chap. 8.1 from SSD1306-Revision_1.1.pdf for more details.The 4-wire serial interface consists of serial clock: SCLK, serial data: SDIN, D/C#, CS#. In 4-wire SPI mode,D0 acts as SCLK, D1 acts as SDIN. For the unused data pins, D2 should be left open. The pins from D3 to D7, E and R/W# (WR#)# can be connected to an external ground.Table 2: 4-wire SPI Control pins of 4-wire Serial interfaceNote(1) H stands for HIGH in signal(2) L stands for LOW in signalSDIN is shifted into an 8-bit shift register on every rising edge of SCLK in the order of D7, D6 0D/C# is sampled on every eighth clock and the data byte in the shift register is written to the Graphic Display Data RAM (GDDRAM) or command register in the same clock.Under serial mode, only write operations are allowed.Figure 2: Write procedure in 4-wire Serial interface modeThe I2C-bus interface gives access to write data and command into the device. Please referto Figure 2 for the write mode of I2C-bus in chronological order.a)Slave address bit (SA0)SSD1306 has to recognize the slave address before transmitting or receiving any information by the I2C-bus. The device will respond to the slave address following by the slave address bit (“SA0”bit) and the read/write select bit (“R/W#” bit) with the following byte format,b7 b6 b5 b4 b6 b2 b1 b00 1 1 1 1 0 SA0 R/W#“SA0” bit provides an extension bit for the slave address. Either “0111100” or3“0111101”, can be selected as the slave address of SSD1306. D/C# pin acts as SA0 for slave address selection. “R/W#” bit is used to determine the operation mode of the I2C-bus interface.R/W#=1, it is in read mode. R/W#=0, it is in write mode.b)I2C-bus data signal (SDA)SDA acts as a communication channel between the transmitter and the receiver. The data and the acknowledgement are sent through the SDA.It should be noticed that the ITO track resistance and the pulled-up resistance at “SDA” pinbecomes a voltage potential divider. As a result, the acknowledgement would not be possible to attain a valid logic 0 level in “SDA””SDAIN” and “SDAOUT” are tied together and serve as SDA. The “SDAIN” pin must be connected to act as SDA. The “SDAOUT” pin may be disconnected. When “SDAOUT” pin is disconnected, the acknowledgement signal will be ignored in the I2C-bus.c)I2C-bus clock signal (SCL)The transmission of information in the I2C-bus is following a clock signal, SCL. Each transmission of data bit is taken place during a single clock period of SCL.Table 3. I2C I2C-bus data format1)The slave address is following the start condition for recognition use. For the SSD1306, the slaveaddress is either “b0111100” or “b0111101” by changing the SA0 to LOW or HIGH (D/C pin acts as SA0).2)The write mode is established by setting the R/W# bit to logic “0”43)An acknowledgement signal will be generated after receiving one byte of data, including theslave address and the R/W# bit.4)After the transmission of the slave address, either the control byte or the data byte may be sentacross the SDA. A control byte mainly consists of Co and D/C# bits following by six “0” ‘s.a)If the Co bit is set as logic “0”, the transmission of the following information will containdata bytes only.b)The D/C# bit determines the next data byte is acted as a command or a data. If the D/C# bitis set to logic “0”, it defines the following data byte as a command. If the D/C# bit is set tologic “1”, it defines the following data byte as a data which will be stored at the GDDRAM.The GDDRAM column address pointer will be increased by one automatically after eachdata write.5)Acknowledge bit will be generated after receiving each control byte or data byte.5。
0.96'OLED(4Pin)模块学习手册(STM8S版)
SSD1306 背面图
模块原理图 第 3 页 共 23 页
深圳市技新电子科技有限公司 www.jixin.pro
0.96’OLED(4Pin)V1.0.0.0
3.2 SSD1306 引脚功能表
引脚号码
符号
类型
功能
电源相关引脚
9
VDD
电源
逻辑电源
这是一个供电引脚,必须连接到外部电源。
0.96’OLED(4Pin)模块采用 SSD1306 为驱动芯片,并集成在 OLED 面板中,像素为 128*64,通讯方式 IIC,地址可选(默认地址 0x78),支持软件模拟 IIC 通讯与硬件 IIC 通讯,上电自动复位,功耗低,自发光自 由视角。模块带有稳压芯片,VCC 输入范围 3.3V~5V,与单片机通讯只需两个 IO 口。
1.3 模块丝印
模块上的每一个器件都有一个相对应的丝印在上面,可以通过 BOM 表中的器件编号在板子找到器件的位 置。
第 1 页 共 23 页
深圳市技新电子科技有限公司 www.jixin.pro
0.96’OLED(4Pin)V1.0.0.0
模块正面丝印图
模块正面丝印图
在模块的正面丝印中,S1 是地址选择焊盘,作用是选择模块通讯地址(不焊为 0,焊上为 1,默认 S1 不 焊,地址为 0x78),地址选择如下表:
8
VSS
电源
逻辑地
这是一个地引脚,它作为逻辑电平的参考引脚,必
须链接到外部地。
28
VCC
电源
OEL 板供电
它必须为芯片电源电压正极引脚,在使用整流器时
要在该引脚与 VSS 之间接入一个电容;如果不使用整 流器时必须接到外部电源。
OLED 模块 使用说明
OLED模块使用说明杭州海视方电子科技(VIP客户版,第一手资料,请勿外传。
所有资料均以官方数据为准,此文仅供参考,谢谢!)2014年12月22日重要提示:OLED屏裸露,玻璃板易碎,使用过程中请勿用力挤压、猛烈撞击,以免造成模块损坏!一、OLED简介:OLED,即有机发光二极管(Organic Light-Emitting Diode),又称为有机电激光显示(Organic Electroluminesence Display,OELD)。
因为具备轻薄、省电等特性,因此从2003年开始,这种显示设备在MP3播放器上得到了广泛应用,而对于同属数码类产品的DC 与手机,此前只是在一些展会上展示过采用OLED屏幕的工程样品。
自2007年后,寿命得到很大提高,具备了许多LCD不可比拟的优势。
二、0.96寸模块板子尺寸:SPI接口IIC接口三、1.3寸SPI接口模块尺寸图SPI接口IIC接口四、外观三种颜色任你选:蓝色、白色、蓝黄双色五、通讯模式:4线SPI、IIC接口六、SPI电路连接GND:电源地VCC:2.2V~5.5VSCL(D0):CLK时钟(高电平2.2V~5.5V)SDA(D1):MOSI数据(高电平2.2V~5.5V)RST:复位(高电平2.2V~5.5V)D/C:数据/命令(高电平2.2V~5.5V)兼容3.3V和5V控制芯片的I/O电平(无需任何设置,直接兼容)板子管脚依次为G(地),3.3V/5V(电源),SCL(CLK时钟),SDA(MISO数据),RES(复位),DC(数据/命令单片机采用 3.3V/5V电压的接线模式,下图以XS128单片机接线图为例:其他单片机只要有4个IO口就可以驱动移植程序非常简单:驱动程序以标准的.C.H文件写出,轻松移植七、IIC电路连接IIC接口:GND:电源地VCC:2.2V~5.5VSCL:CLK时钟(高电平2.2V~5.5V)SDA:MOSI数据(高电平2.2V~5.5V)注意事项:OLED显示屏不同于LCD,OLED上电是没有反应的,需要程序驱动才会有显示!。
0.96寸OLED液晶屏模块
0.96寸OLED显示屏一、OLED简介OLED,即有机发光二级管(Organic Light Emitting Diode)。
OLED由于同时具备自发光,不需背光源、对比度高、厚度薄、视角广、反应速度快、可用于扭曲性面板、使用温度范围广、构造及制作较简单等优异的特性,被认为是下一代的平面显示器新兴应用技术。
LCD都需要背光,而OLED不需要,因为它是自发光的。
这样同样的显示,OLED效果要来得好一些。
以目前的技术,OLED的尺寸还难以大型化,但是分辨率确可以做到很高。
在此我们使用的是中景园电子的0.96寸OLED显示屏,该屏有以下特点:1、0.96寸OLED有黄蓝、白、蓝三种颜色可以选择,其中黄蓝是屏上1/4部分为黄光,下3/4位蓝光,而且是固定区域显示固定颜色,颜色和显示区域均不能修改。
白光则为纯白,也就是黑底白字。
蓝光则为纯蓝,也就是黑底蓝字。
2、分辨率为128*64,每个像素都是一个LED。
3、多种接口方式,OLED裸屏的接口方式有5种:6800、8080两种并行接口方式、3线或4线的串行SPI接口方式、I2C接口方式(只需要用到2根线就可以控制OLED了!),这5种接口方式是通过屏上的BS0~BS2来配置的。
4、中景园电子的屏开发了两种接口的DEMO板,接口分别为七针的SPI/I2C兼容模块,四针的I2C模块,两种模块都很方便使用,我们可以根据实际需求来选择不同的模块。
二、模块特点:1、0.96寸OLED裸屏外观裸屏为30Pin,从屏正面看左下角为1脚,右下角为30脚。
在设计的时候一定要注意不要弄反了。
具体的接口方式请大家查看0.96寸OLED官方数据手册,里面有详细介绍。
2、0.96寸OLED模块(1)SPI/I2C接口模块(7脚)(2)I2C接口模块(4脚)3、0.96寸OLED的驱动IC芯片(SSD1306)本屏所用的驱动IC芯片为SSD1306,其具有内部升压功能,所以在设计的时候就不需要再专门设计升压电路了。
0.96英寸IPS屏显示模块用户手册说明书
0.96inch LCD ModuleUser ManualOVERVIEWThis is a general LCD display Module, IPS screen, 0.96inch diagonal, 160x80 HD resolution, with embedded controller, communicating via SPI interface.Examples are provided for testing. Examples are compatible with Raspberry Pi (bcm2835, wiringPi and python), STM32 and ArduinoSPECIFICATIONOperating Voltage : 3.3VInterface : SPIType : TFTControl Driver : ST7735SResolution : 160 (V) RGB x 80 (H) mmViewing Area : 21.7 (V) x 10.8 (H) mmPixel size : 0.1356(V)x 0.135(H)mmDimension : 32.5 x 26.00 (mm)PINOUTOverview (1)Specification (1)Pinout (2)Hardware (5)Controller (5)Communication protocol (5)Demo codes (7)Download (7)Raspberry Pi (7)Copy to Raspberry Pi (7)Libraries install (8)Hardware connection (10)Running examples (10)Expected result (11)STM32 (12)Hardware connection (12)Expected result (12)Arduino (13)Hardware connection (13)Expected result (13)FAQ (14)CONTROLLERST7735S is a controller for 162 x RGB x132 LCD. Note that the resolution of this LCD module is 160(H)RGBx80(V) indeed.ST7735S supports RGB444, RGB565 and RGB666 three formats. This LCD module we use RGB565.Because that the first pixel of the LCD is different with the origin point of controller, therefore, we should offset the position when initialize the module: Horizontal: begin from the second pixel; Vertical: begin from the 27th pixel. Make sure that the display position of LCD is same as RAM.For most of the LCD controller, there are several interfaces for choosing, this module we use SPI interface which is fast and simple.COMMUNICATION PROTOCOLNote: It is not like the tradition SPI protocol, it only uses MOSI to send data from master to slave for LCD display. For details please refer to Datasheet Page 105. RESX: Reset, should be pull-down when power on, set to 1 other time.CSX: Slave chip select. The chip is enabled only CS is set LowD/CX: Data/Command selection; DC=0, write command; DC=1, write dataSDA: Data transmitted. (RGB data)SCL: SPI clockThe SPI communication protocol of the data transmission uses control bits: clock phase (CPHA) and clock polarity (CPOL):CPOL defines the level while synchronization clock is idle. If CPOL=0, then it is LOW. CPHA defines at wh ish clock’s tick the data transmission starts. CPHL=0 – at the first one, otherwise at the second oneThis combination of two bits provides 4 modes of SPI data transmission. The commonly used is SPI0 mode, i.e. GPHL=0 and CPOL=0.According to the figure above, data transmitting begins at the first falling edge, 8bit data are transmitted at one clock cycle. It is SPI0. MSB.DOWNLOADVisit Waveshare wiki and search for 0.96inch LCD Module. Download the demo code:Extract and get the folders as below:Arduino: For Arduino UNORaspberry Pi: Includes three examples, BCM2835, WiringPi and PythonSTM32: For XNUCLEO-F103RB, which integrate STM32F103RBT6RASPBERRY PICOPY TO RASPBERRY PI1.Insert SD card which has Raspbian installed to your PC2.Copy RaspberryPi extracted to root directory (BOOT) of SD card3.Power on your Raspberry Pi and open Terminal, you can find that the examples islisted in boot directory4.Copy the RaspberryPi folder to /home/pi and change its execute permission.LIBRARIES INSTALLTo use the demo codes, you need to first install librariesInstall BCM2835:xx is the version of library. For example, if the library you download is bcm2835-1.52, the command should be : sudo tar zxvf bcm2835-1.52.tar.gzInstall wiringPi:Install Python libraries:HARDWARE CONNECTIONRUNNING EXAMPLESEnter the folder: cd RaspberryPi/bcm2835 example:Press Ctrl and C to stop running wiringpi example:Press Ctrl and C to stop running python example:Press Ctrl and C to stop running EXPECTED RESULT1.Clear screen2.Display number and strings3.Draw figures4.Display 40 x 40 image5.Display 160x80 imageSTM32The development board used is XNUCLEO-F103RB, based on HAL library HARDWARE CONNECTIONEXPECTED RESULT1.Clear screen2.Display number and strings3.Draw figures4.Display 40x40 image5.Display 160x80 imageARDUINOThis example is compatible with Arduino UNO HARDWARE CONNECTIONEXPECTED RESULT1.Clear screen2.Display number and strings3.Display figures4.Display 40x40 imageFAQ1.How to control backlight?- You can use the function LCD_SetBacklight() to control the backlight2.Why the LCD is black when working with Raspberry Pia) Check if SPI interface was enabledb) Check if the BL pin work normally, if the pin has no output, please try todisconnect the BL control pin3.What does it happen if using Raspberry Pi improperly?If you run python or bcm2835 examples after wiringPi, the LCD may cannot work normally, please try to restart Raspberry Pi can try again.4.How to rotate display?-You can use the function Paint_SetRotate(Rotate) to rotate display. Rotate should be 0, 90, 180 or 270.-Python can call rotate(Rotate) function for any angle.5.Python Image library- For some of the OS, you should execute command to install python-imaging library: sudo apt-get install python-imaging。
TFT LCD 0.96英寸指南说明书
Instruction ManualOverviewAn IPS, full colour TFT module, offering 80 degree viewing angles allround, with a 500nit backlight. It is a transmissive type display operating in the normally black mode.This TFT LCD has a 0.96-inch diagonally measured active display area with 80 x 160 dot (80 horizontal by 160 vertical pixel) resolution. Each pixel is divided into Red, Green, Blue dots which are arranged in vertical stripes.Technical Specificationsz Size: 0.96 inchz Dot Matrix: 80 x RGB x 160(TFT) dotsz Module dimension: 13.5(W) x 27.95(H) x 3.00(D) mmz Active area: 10.8 x 21.696 mmz Dot pitch: 0.135 x 0.1356 mmz LCD type: TFT, Normally black, Transmissivez Viewing Angle: 80/80/80/80z Aspect Ratio: 1:2z IC: ST7735Sz Backlight Type: LED,Normally Whitez With /Without TP: Without TPz Surface: Glare*Colour tone slight changed by temperature and driving voltage.InterfacePin DefinitionTechnical DrawingAbsolute Maximum Ratings1. Temp. ≤60˚C, 90% RH MAX. Temp.>60˚C, Absolute humidity shall be less than 90% RH at 60˚C.Electrical CharacteristicsOperating conditions:Note 1 : There are 1 Groups LEDNote 2 : Ta = 25 ˚CNote 3 : Brightness to be decreased to 50% of the initial valueNote 4 : The single LED lamp caseData Colour Coding3-Wire SPI Mode: RGB 5-6-5-bit Input, 65K-Colours, 3AH=“05h”Look-up table for 65k colour mapping (16 bits to 18 bits) Note 1: Pixel data with the 16-bit colour depth informationNote 2: The most significant bits are: Rx4, Gx5 and Bx4Note 3: The least significant bits are: Rx0, Gx0 and Bx04-Wire SPI Mode: RGB 5-6-5-bit Input, 65K-Colours, 3AH=“05h”Look-up table for 65k colour mapping (16 bits to 18 bits) Note 1. Pixel data with the 16-bit colour depth informationNote 2. The most significant bits are: Rx4, Gx5 and Bx4Note 3. The least significant bits are: Rx0, Gx0 and Bx0Display Options availableTFT display as a stand-alone itemDisplay on pcb with mountingOptical CharacteristicsTa=25±2˚CNote 1: Definition of viewing angle rangeNote 2: Test equipment setup:After stabilizing and leaving the panel alone at a driven temperature for 10 minutes, the measurement should be executed. Measurement should be executed in a stable, windless, and dark room. Optical specifications are measured by Topcon BM-7orBM-5 luminance meter 1.0° field of view at a distance of 50cm and normal direction.Note 3: Definition of Response time:The response time is defined as the LCD optical switching time interval between “White” state and “Black” state. Rise time, Tr, is the time between photo detector output intensity changed from 90%to 10%.Black(TFT ON)White(TFT OFF)White(TFT OFF)100%90%10%0%DisplayNote 4: Definition of contrast ratio:The contrast ratio is defined as the following expression.Luminance measured when LCD on the “White” state Contrast ratio (CR) = Luminance measured when LCD on the “Black” stateNote 5: White Vi = Vi50 ± 1.5V Black Vi = Vi50 ± 2.0V“±” means that the analog input signal swings in phase with VCOM signal.“±” means that the analog input signal swings out of phase with VCOM signal.The 100% transmission is defined as the transmission of LCD panel when all the input terminals of module are electrically opened.Note 6: Definition of colour chromaticity (CIE 1931)Colour coordinates measured at the center point of LCDNote 7: Measured at the center area of the panel when all the input terminals of LCD panel are electrically opened.ReliabilityContent of Reliability Test (Wide temperature, -20˚C~70˚C)Environmental TestNote1: No dew condensation to be observed.Note2: The function test shall be conducted after 4 hours storage at the normal Temperature and humidity after remove from the test chamber.Note3: The packing have to including into the vibration testing.。
0.96寸OLED介绍第二讲
0.96寸OLED显示屏介绍0.96 寸OLED 显示屏使用方法(以中景园电子的0.96 寸OLED 显示屏为例)0.96寸OLED显示屏实物图七针SPI/IIC 0.96寸OLED显示屏使用方法:七针SPI/IIC 0.96寸OLED显示屏共有七个管脚,1~7 分别为GDN、VCC、D0、D1、RES、DC、CS。
此模块支持四线SPI、三线SPI、IIC 接口。
0.96寸OLED显示屏裸屏是支持五种不同接口的,除了前面的三种还有6800、8080 并口方式;由于这两种接口占用数据线比较多;而且不太常用,所以模块在设计的时候没有引出来。
模块的通信接口是通过BS0,BS1,BS2三个管脚来配置的。
在SPI 接口中,R1,R2,R8 三个电阻是不焊接的。
在IIC 接口中,需要将R3换到R1上,R8 可以焊接也可不焊接。
七针SPI/IIC 0.96寸OLED显示屏正面丝印如下,如果想用IIC接口,在IIC接口中需要将RES接高电平,可以与VCC对接,使OLED复位脚一直操持高电平,也就是不复位的状态;同时需要将DC,CS 接电源地;IIC 通信中只需要GND ,VCC,D0(时钟信号),D1(数据信号)四根线。
如果感觉比较麻烦;也可以直接选用四针的IIC接口的0.96寸OLED显示屏。
四针IIC接口相对比较简单一些,只有两个信号线。
1、GND:电源地。
2、VCC:电源正(3~5.5V)。
3、SCL:OLED 的D0 脚,在IIC 通信中为时钟管脚。
4、SDA:OLED 的D1 脚,在IIC 通信中为数据管脚。
0.96 寸OLED显示屏例程:/****************0.96英寸OLED显示信息***************** 处理器:STM32F103C8T6程序功能:开发板上电后在oled液晶屏中显示一些提示信息。
*****************************************************/ #include "sys.h"#include "stdlib.h"#define OLED_RST_Clr() PCout(13)=0 //RST#define OLED_RST_Set() PCout(13)=1 //RST#define OLED_RS_Clr() PBout(4)=0 //DC#define OLED_RS_Set() PBout(4)=1 //DC#define OLED_SCLK_Clr() PCout(15)=0 //SCL#define OLED_SCLK_Set() PCout(15)=1 //SCL#define OLED_SDIN_Clr() PCout(14)=0 //SDA#define OLED_SDIN_Set() PCout(14)=1 //SDA#define OLED_CMD 0 //写命令#define OLED_DATA 1 //写数据void delay_init(u8 SYSCLK);void delay_ms(u16 nms);void delay_us(u32 nus);void OLED_WR_Byte(u8 dat,u8 cmd);void OLED_Display_On(void);void OLED_Display_Off(void);void OLED_Refresh_Gram(void);void Oled_Init(void);void OLED_Clear(void);void OLED_DrawPoint(u8 x,u8 y,u8 t);void OLED_ShowChar(u8 x,u8 y,u8 chr,u8 size,u8 mode); void OLED_ShowNumber(u8 x,u8 y,u32 num,u8 len,u8 size); void OLED_ShowString(u8 x,u8 y,const u8 *p);void Oled_Show(void);u8 OLED_GRAM[128][8];const unsigned char oled_asc2_1206[95][12]={{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*" ",0*/ {0x00,0x00,0x00,0x00,0x3F,0x40,0x00,0x00,0x00,0x00,0x00,0x00},/*"!",1*/ {0x00,0x00,0x30,0x00,0x40,0x00,0x30,0x00,0x40,0x00,0x00,0x00},/*""",2*/ {0x09,0x00,0x0B,0xC0,0x3D,0x00,0x0B,0xC0,0x3D,0x00,0x09,0x00},/*"#",3*/ {0x18,0xC0,0x24,0x40,0x7F,0xE0,0x22,0x40,0x31,0x80,0x00,0x00},/*"$",4*/ {0x18,0x00,0x24,0xC0,0x1B,0x00,0x0D,0x80,0x32,0x40,0x01,0x80},/*"%",5*/ {0x03,0x80,0x1C,0x40,0x27,0x40,0x1C,0x80,0x07,0x40,0x00,0x40},/*"&",6*/ {0x10,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"'",7*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x80,0x20,0x40,0x40,0x20},/*"(",8*/ {0x00,0x00,0x40,0x20,0x20,0x40,0x1F,0x80,0x00,0x00,0x00,0x00},/*")",9*/ {0x09,0x00,0x06,0x00,0x1F,0x80,0x06,0x00,0x09,0x00,0x00,0x00},/*"*",10*/ {0x04,0x00,0x04,0x00,0x3F,0x80,0x04,0x00,0x04,0x00,0x00,0x00},/*"+",11*/ {0x00,0x10,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*",",12*/ {0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x00,0x00},/*"-",13*/ {0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*".",14*/ {0x00,0x20,0x01,0xC0,0x06,0x00,0x38,0x00,0x40,0x00,0x00,0x00},/*"/",15*/ {0x1F,0x80,0x20,0x40,0x20,0x40,0x20,0x40,0x1F,0x80,0x00,0x00},/*"0",16*/ {0x00,0x00,0x10,0x40,0x3F,0xC0,0x00,0x40,0x00,0x00,0x00,0x00},/*"1",17*/ {0x18,0xC0,0x21,0x40,0x22,0x40,0x24,0x40,0x18,0x40,0x00,0x00},/*"2",18*/ {0x10,0x80,0x20,0x40,0x24,0x40,0x24,0x40,0x1B,0x80,0x00,0x00},/*"3",19*/ {0x02,0x00,0x0D,0x00,0x11,0x00,0x3F,0xC0,0x01,0x40,0x00,0x00},/*"4",20*/ {0x3C,0x80,0x24,0x40,0x24,0x40,0x24,0x40,0x23,0x80,0x00,0x00},/*"5",21*/ {0x1F,0x80,0x24,0x40,0x24,0x40,0x34,0x40,0x03,0x80,0x00,0x00},/*"6",22*/ {0x30,0x00,0x20,0x00,0x27,0xC0,0x38,0x00,0x20,0x00,0x00,0x00},/*"7",23*/ {0x1B,0x80,0x24,0x40,0x24,0x40,0x24,0x40,0x1B,0x80,0x00,0x00},/*"8",24*/ {0x1C,0x00,0x22,0xC0,0x22,0x40,0x22,0x40,0x1F,0x80,0x00,0x00},/*"9",25*/ {0x00,0x00,0x00,0x00,0x08,0x40,0x00,0x00,0x00,0x00,0x00,0x00},/*":",26*/ {0x00,0x00,0x00,0x00,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00},/*";",27*/ {0x00,0x00,0x04,0x00,0x0A,0x00,0x11,0x00,0x20,0x80,0x40,0x40},/*"<",28*/ {0x09,0x00,0x09,0x00,0x09,0x00,0x09,0x00,0x09,0x00,0x00,0x00},/*"=",29*/ {0x00,0x00,0x40,0x40,0x20,0x80,0x11,0x00,0x0A,0x00,0x04,0x00},/*">",30*/ {0x18,0x00,0x20,0x00,0x23,0x40,0x24,0x00,0x18,0x00,0x00,0x00},/*"?",31*/ {0x1F,0x80,0x20,0x40,0x27,0x40,0x29,0x40,0x1F,0x40,0x00,0x00},/*"@",32*/ {0x00,0x40,0x07,0xC0,0x39,0x00,0x0F,0x00,0x01,0xC0,0x00,0x40},/*"A",33*/ {0x20,0x40,0x3F,0xC0,0x24,0x40,0x24,0x40,0x1B,0x80,0x00,0x00},/*"B",34*/ {0x1F,0x80,0x20,0x40,0x20,0x40,0x20,0x40,0x30,0x80,0x00,0x00},/*"C",35*/ {0x20,0x40,0x3F,0xC0,0x20,0x40,0x20,0x40,0x1F,0x80,0x00,0x00},/*"D",36*/ {0x20,0x40,0x3F,0xC0,0x24,0x40,0x2E,0x40,0x30,0xC0,0x00,0x00},/*"E",37*/ {0x20,0x40,0x3F,0xC0,0x24,0x40,0x2E,0x00,0x30,0x00,0x00,0x00},/*"F",38*/ {0x0F,0x00,0x10,0x80,0x20,0x40,0x22,0x40,0x33,0x80,0x02,0x00},/*"G",39*/ {0x20,0x40,0x3F,0xC0,0x04,0x00,0x04,0x00,0x3F,0xC0,0x20,0x40},/*"H",40*/ {0x20,0x40,0x20,0x40,0x3F,0xC0,0x20,0x40,0x20,0x40,0x00,0x00},/*"I",41*/ {0x00,0x60,0x20,0x20,0x20,0x20,0x3F,0xC0,0x20,0x00,0x20,0x00},/*"J",42*/ {0x20,0x40,0x3F,0xC0,0x24,0x40,0x0B,0x00,0x30,0xC0,0x20,0x40},/*"K",43*/{0x20,0x40,0x3F,0xC0,0x20,0x40,0x00,0x40,0x00,0x40,0x00,0xC0},/*"L",44*/ {0x3F,0xC0,0x3C,0x00,0x03,0xC0,0x3C,0x00,0x3F,0xC0,0x00,0x00},/*"M",45*/ {0x20,0x40,0x3F,0xC0,0x0C,0x40,0x23,0x00,0x3F,0xC0,0x20,0x00},/*"N",46*/ {0x1F,0x80,0x20,0x40,0x20,0x40,0x20,0x40,0x1F,0x80,0x00,0x00},/*"O",47*/ {0x20,0x40,0x3F,0xC0,0x24,0x40,0x24,0x00,0x18,0x00,0x00,0x00},/*"P",48*/ {0x1F,0x80,0x21,0x40,0x21,0x40,0x20,0xE0,0x1F,0xA0,0x00,0x00},/*"Q",49*/ {0x20,0x40,0x3F,0xC0,0x24,0x40,0x26,0x00,0x19,0xC0,0x00,0x40},/*"R",50*/ {0x18,0xC0,0x24,0x40,0x24,0x40,0x22,0x40,0x31,0x80,0x00,0x00},/*"S",51*/ {0x30,0x00,0x20,0x40,0x3F,0xC0,0x20,0x40,0x30,0x00,0x00,0x00},/*"T",52*/ {0x20,0x00,0x3F,0x80,0x00,0x40,0x00,0x40,0x3F,0x80,0x20,0x00},/*"U",53*/ {0x20,0x00,0x3E,0x00,0x01,0xC0,0x07,0x00,0x38,0x00,0x20,0x00},/*"V",54*/ {0x38,0x00,0x07,0xC0,0x3C,0x00,0x07,0xC0,0x38,0x00,0x00,0x00},/*"W",55*/ {0x20,0x40,0x39,0xC0,0x06,0x00,0x39,0xC0,0x20,0x40,0x00,0x00},/*"X",56*/ {0x20,0x00,0x38,0x40,0x07,0xC0,0x38,0x40,0x20,0x00,0x00,0x00},/*"Y",57*/ {0x30,0x40,0x21,0xC0,0x26,0x40,0x38,0x40,0x20,0xC0,0x00,0x00},/*"Z",58*/ {0x00,0x00,0x00,0x00,0x7F,0xE0,0x40,0x20,0x40,0x20,0x00,0x00},/*"[",59*/ {0x00,0x00,0x70,0x00,0x0C,0x00,0x03,0x80,0x00,0x40,0x00,0x00},/*"\",60*/ {0x00,0x00,0x40,0x20,0x40,0x20,0x7F,0xE0,0x00,0x00,0x00,0x00},/*"]",61*/ {0x00,0x00,0x20,0x00,0x40,0x00,0x20,0x00,0x00,0x00,0x00,0x00},/*"^",62*/ {0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10},/*"_",63*/ {0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"`",64*/ {0x00,0x00,0x02,0x80,0x05,0x40,0x05,0x40,0x03,0xC0,0x00,0x40},/*"a",65*/ {0x20,0x00,0x3F,0xC0,0x04,0x40,0x04,0x40,0x03,0x80,0x00,0x00},/*"b",66*/ {0x00,0x00,0x03,0x80,0x04,0x40,0x04,0x40,0x06,0x40,0x00,0x00},/*"c",67*/ {0x00,0x00,0x03,0x80,0x04,0x40,0x24,0x40,0x3F,0xC0,0x00,0x40},/*"d",68*/ {0x00,0x00,0x03,0x80,0x05,0x40,0x05,0x40,0x03,0x40,0x00,0x00},/*"e",69*/ {0x00,0x00,0x04,0x40,0x1F,0xC0,0x24,0x40,0x24,0x40,0x20,0x00},/*"f",70*/ {0x00,0x00,0x02,0xE0,0x05,0x50,0x05,0x50,0x06,0x50,0x04,0x20},/*"g",71*/ {0x20,0x40,0x3F,0xC0,0x04,0x40,0x04,0x00,0x03,0xC0,0x00,0x40},/*"h",72*/ {0x00,0x00,0x04,0x40,0x27,0xC0,0x00,0x40,0x00,0x00,0x00,0x00},/*"i",73*/ {0x00,0x10,0x00,0x10,0x04,0x10,0x27,0xE0,0x00,0x00,0x00,0x00},/*"j",74*/ {0x20,0x40,0x3F,0xC0,0x01,0x40,0x07,0x00,0x04,0xC0,0x04,0x40},/*"k",75*/ {0x20,0x40,0x20,0x40,0x3F,0xC0,0x00,0x40,0x00,0x40,0x00,0x00},/*"l",76*/ {0x07,0xC0,0x04,0x00,0x07,0xC0,0x04,0x00,0x03,0xC0,0x00,0x00},/*"m",77*/ {0x04,0x40,0x07,0xC0,0x04,0x40,0x04,0x00,0x03,0xC0,0x00,0x40},/*"n",78*/ {0x00,0x00,0x03,0x80,0x04,0x40,0x04,0x40,0x03,0x80,0x00,0x00},/*"o",79*/ {0x04,0x10,0x07,0xF0,0x04,0x50,0x04,0x40,0x03,0x80,0x00,0x00},/*"p",80*/ {0x00,0x00,0x03,0x80,0x04,0x40,0x04,0x50,0x07,0xF0,0x00,0x10},/*"q",81*/ {0x04,0x40,0x07,0xC0,0x02,0x40,0x04,0x00,0x04,0x00,0x00,0x00},/*"r",82*/ {0x00,0x00,0x06,0x40,0x05,0x40,0x05,0x40,0x04,0xC0,0x00,0x00},/*"s",83*/ {0x00,0x00,0x04,0x00,0x1F,0x80,0x04,0x40,0x00,0x40,0x00,0x00},/*"t",84*/ {0x04,0x00,0x07,0x80,0x00,0x40,0x04,0x40,0x07,0xC0,0x00,0x40},/*"u",85*/ {0x04,0x00,0x07,0x00,0x04,0xC0,0x01,0x80,0x06,0x00,0x04,0x00},/*"v",86*/ {0x06,0x00,0x01,0xC0,0x07,0x00,0x01,0xC0,0x06,0x00,0x00,0x00},/*"w",87*/{0x04,0x40,0x06,0xC0,0x01,0x00,0x06,0xC0,0x04,0x40,0x00,0x00},/*"x",88*/{0x04,0x10,0x07,0x10,0x04,0xE0,0x01,0x80,0x06,0x00,0x04,0x00},/*"y",89*/{0x00,0x00,0x04,0x40,0x05,0xC0,0x06,0x40,0x04,0x40,0x00,0x00},/*"z",90*/{0x00,0x00,0x00,0x00,0x04,0x00,0x7B,0xE0,0x40,0x20,0x00,0x00},/*"{",91*/{0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xF0,0x00,0x00,0x00,0x00},/*"|",92*/{0x00,0x00,0x40,0x20,0x7B,0xE0,0x04,0x00,0x00,0x00,0x00,0x00},/*"}",93*/{0x40,0x00,0x80,0x00,0x40,0x00,0x20,0x00,0x20,0x00,0x40,0x00},/*"~",94*/};const unsigned char oled_asc2_1608[95][16]={{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*" ",0*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xCC,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00},/*"!",1*/ {0x00,0x00,0x08,0x00,0x30,0x00,0x60,0x00,0x08,0x00,0x30,0x00,0x60,0x00,0x00,0x00},/*""",2*/ {0x02,0x20,0x03,0xFC,0x1E,0x20,0x02,0x20,0x03,0xFC,0x1E,0x20,0x02,0x20,0x00,0x00},/*"#",3*/ {0x00,0x00,0x0E,0x18,0x11,0x04,0x3F,0xFF,0x10,0x84,0x0C,0x78,0x00,0x00,0x00,0x00},/*"$",4*/ {0x0F,0x00,0x10,0x84,0x0F,0x38,0x00,0xC0,0x07,0x78,0x18,0x84,0x00,0x78,0x00,0x00},/*"%",5*/ {0x00,0x78,0x0F,0x84,0x10,0xC4,0x11,0x24,0x0E,0x98,0x00,0xE4,0x00,0x84,0x00,0x08},/*"&",6*/ {0x08,0x00,0x68,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"'",7*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xE0,0x18,0x18,0x20,0x04,0x40,0x02,0x00,0x00},/*"(",8*/ {0x00,0x00,0x40,0x02,0x20,0x04,0x18,0x18,0x07,0xE0,0x00,0x00,0x00,0x00,0x00,0x00},/*")",9*/ {0x02,0x40,0x02,0x40,0x01,0x80,0x0F,0xF0,0x01,0x80,0x02,0x40,0x02,0x40,0x00,0x00},/*"*",10*/ {0x00,0x80,0x00,0x80,0x00,0x80,0x0F,0xF8,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x00},/*"+",11*/ {0x00,0x01,0x00,0x0D,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*",",12*/ {0x00,0x00,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80},/*"-",13*/ {0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*".",14*/ {0x00,0x00,0x00,0x06,0x00,0x18,0x00,0x60,0x01,0x80,0x06,0x00,0x18,0x00,0x20,0x00},/*"/",15*/ {0x00,0x00,0x07,0xF0,0x08,0x08,0x10,0x04,0x10,0x04,0x08,0x08,0x07,0xF0,0x00,0x00},/*"0",16*/ {0x00,0x00,0x08,0x04,0x08,0x04,0x1F,0xFC,0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x00},/*"1",17*/ {0x00,0x00,0x0E,0x0C,0x10,0x14,0x10,0x24,0x10,0x44,0x11,0x84,0x0E,0x0C,0x00,0x00},/*"2",18*/ {0x00,0x00,0x0C,0x18,0x10,0x04,0x11,0x04,0x11,0x04,0x12,0x88,0x0C,0x70,0x00,0x00},/*"3",19*/ {0x00,0x00,0x00,0xE0,0x03,0x20,0x04,0x24,0x08,0x24,0x1F,0xFC,0x00,0x24,0x00,0x00},/*"4",20*/ {0x00,0x00,0x1F,0x98,0x10,0x84,0x11,0x04,0x11,0x04,0x10,0x88,0x10,0x70,0x00,0x00},/*"5",21*/ {0x00,0x00,0x07,0xF0,0x08,0x88,0x11,0x04,0x11,0x04,0x18,0x88,0x00,0x70,0x00,0x00},/*"6",22*/ {0x00,0x00,0x1C,0x00,0x10,0x00,0x10,0xFC,0x13,0x00,0x1C,0x00,0x10,0x00,0x00,0x00},/*"7",23*/ {0x00,0x00,0x0E,0x38,0x11,0x44,0x10,0x84,0x10,0x84,0x11,0x44,0x0E,0x38,0x00,0x00},/*"8",24*/ {0x00,0x00,0x07,0x00,0x08,0x8C,0x10,0x44,0x10,0x44,0x08,0x88,0x07,0xF0,0x00,0x00},/*"9",25*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x0C,0x03,0x0C,0x00,0x00,0x00,0x00,0x00,0x00},/*":",26*/ {0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*";",27*/ {0x00,0x00,0x00,0x80,0x01,0x40,0x02,0x20,0x04,0x10,0x08,0x08,0x10,0x04,0x00,0x00},/*"<",28*/ {0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x00,0x00},/*"=",29*/ {0x00,0x00,0x10,0x04,0x08,0x08,0x04,0x10,0x02,0x20,0x01,0x40,0x00,0x80,0x00,0x00},/*">",30*/ {0x00,0x00,0x0E,0x00,0x12,0x00,0x10,0x0C,0x10,0x6C,0x10,0x80,0x0F,0x00,0x00,0x00},/*"?",31*/ {0x03,0xE0,0x0C,0x18,0x13,0xE4,0x14,0x24,0x17,0xC4,0x08,0x28,0x07,0xD0,0x00,0x00},/*"@",32*/ {0x00,0x04,0x00,0x3C,0x03,0xC4,0x1C,0x40,0x07,0x40,0x00,0xE4,0x00,0x1C,0x00,0x04},/*"A",33*/ {0x10,0x04,0x1F,0xFC,0x11,0x04,0x11,0x04,0x11,0x04,0x0E,0x88,0x00,0x70,0x00,0x00},/*"B",34*/{0x10,0x04,0x1F,0xFC,0x10,0x04,0x10,0x04,0x10,0x04,0x08,0x08,0x07,0xF0,0x00,0x00},/*"D",36*/ {0x10,0x04,0x1F,0xFC,0x11,0x04,0x11,0x04,0x17,0xC4,0x10,0x04,0x08,0x18,0x00,0x00},/*"E",37*/ {0x10,0x04,0x1F,0xFC,0x11,0x04,0x11,0x00,0x17,0xC0,0x10,0x00,0x08,0x00,0x00,0x00},/*"F",38*/ {0x03,0xE0,0x0C,0x18,0x10,0x04,0x10,0x04,0x10,0x44,0x1C,0x78,0x00,0x40,0x00,0x00},/*"G",39*/ {0x10,0x04,0x1F,0xFC,0x10,0x84,0x00,0x80,0x00,0x80,0x10,0x84,0x1F,0xFC,0x10,0x04},/*"H",40*/ {0x00,0x00,0x10,0x04,0x10,0x04,0x1F,0xFC,0x10,0x04,0x10,0x04,0x00,0x00,0x00,0x00},/*"I",41*/ {0x00,0x03,0x00,0x01,0x10,0x01,0x10,0x01,0x1F,0xFE,0x10,0x00,0x10,0x00,0x00,0x00},/*"J",42*/ {0x10,0x04,0x1F,0xFC,0x11,0x04,0x03,0x80,0x14,0x64,0x18,0x1C,0x10,0x04,0x00,0x00},/*"K",43*/ {0x10,0x04,0x1F,0xFC,0x10,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x0C,0x00,0x00},/*"L",44*/ {0x10,0x04,0x1F,0xFC,0x1F,0x00,0x00,0xFC,0x1F,0x00,0x1F,0xFC,0x10,0x04,0x00,0x00},/*"M",45*/ {0x10,0x04,0x1F,0xFC,0x0C,0x04,0x03,0x00,0x00,0xE0,0x10,0x18,0x1F,0xFC,0x10,0x00},/*"N",46*/ {0x07,0xF0,0x08,0x08,0x10,0x04,0x10,0x04,0x10,0x04,0x08,0x08,0x07,0xF0,0x00,0x00},/*"O",47*/ {0x10,0x04,0x1F,0xFC,0x10,0x84,0x10,0x80,0x10,0x80,0x10,0x80,0x0F,0x00,0x00,0x00},/*"P",48*/ {0x07,0xF0,0x08,0x18,0x10,0x24,0x10,0x24,0x10,0x1C,0x08,0x0A,0x07,0xF2,0x00,0x00},/*"Q",49*/ {0x10,0x04,0x1F,0xFC,0x11,0x04,0x11,0x00,0x11,0xC0,0x11,0x30,0x0E,0x0C,0x00,0x04},/*"R",50*/ {0x00,0x00,0x0E,0x1C,0x11,0x04,0x10,0x84,0x10,0x84,0x10,0x44,0x1C,0x38,0x00,0x00},/*"S",51*/ {0x18,0x00,0x10,0x00,0x10,0x04,0x1F,0xFC,0x10,0x04,0x10,0x00,0x18,0x00,0x00,0x00},/*"T",52*/ {0x10,0x00,0x1F,0xF8,0x10,0x04,0x00,0x04,0x00,0x04,0x10,0x04,0x1F,0xF8,0x10,0x00},/*"U",53*/ {0x10,0x00,0x1E,0x00,0x11,0xE0,0x00,0x1C,0x00,0x70,0x13,0x80,0x1C,0x00,0x10,0x00},/*"V",54*/ {0x1F,0xC0,0x10,0x3C,0x00,0xE0,0x1F,0x00,0x00,0xE0,0x10,0x3C,0x1F,0xC0,0x00,0x00},/*"W",55*/ {0x10,0x04,0x18,0x0C,0x16,0x34,0x01,0xC0,0x01,0xC0,0x16,0x34,0x18,0x0C,0x10,0x04},/*"X",56*/ {0x10,0x00,0x1C,0x00,0x13,0x04,0x00,0xFC,0x13,0x04,0x1C,0x00,0x10,0x00,0x00,0x00},/*"Y",57*/ {0x08,0x04,0x10,0x1C,0x10,0x64,0x10,0x84,0x13,0x04,0x1C,0x04,0x10,0x18,0x00,0x00},/*"Z",58*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFE,0x40,0x02,0x40,0x02,0x40,0x02,0x00,0x00},/*"[",59*/ {0x00,0x00,0x30,0x00,0x0C,0x00,0x03,0x80,0x00,0x60,0x00,0x1C,0x00,0x03,0x00,0x00},/*"\",60*/ {0x00,0x00,0x40,0x02,0x40,0x02,0x40,0x02,0x7F,0xFE,0x00,0x00,0x00,0x00,0x00,0x00},/*"]",61*/ {0x00,0x00,0x00,0x00,0x20,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x20,0x00,0x00,0x00},/*"^",62*/ {0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01},/*"_",63*/ {0x00,0x00,0x40,0x00,0x40,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"`",64*/ {0x00,0x00,0x00,0x98,0x01,0x24,0x01,0x44,0x01,0x44,0x01,0x44,0x00,0xFC,0x00,0x04},/*"a",65*/ {0x10,0x00,0x1F,0xFC,0x00,0x88,0x01,0x04,0x01,0x04,0x00,0x88,0x00,0x70,0x00,0x00},/*"b",66*/ {0x00,0x00,0x00,0x70,0x00,0x88,0x01,0x04,0x01,0x04,0x01,0x04,0x00,0x88,0x00,0x00},/*"c",67*/ {0x00,0x00,0x00,0x70,0x00,0x88,0x01,0x04,0x01,0x04,0x11,0x08,0x1F,0xFC,0x00,0x04},/*"d",68*/ {0x00,0x00,0x00,0xF8,0x01,0x44,0x01,0x44,0x01,0x44,0x01,0x44,0x00,0xC8,0x00,0x00},/*"e",69*/ {0x00,0x00,0x01,0x04,0x01,0x04,0x0F,0xFC,0x11,0x04,0x11,0x04,0x11,0x00,0x18,0x00},/*"f",70*/ {0x00,0x00,0x00,0xD6,0x01,0x29,0x01,0x29,0x01,0x29,0x01,0xC9,0x01,0x06,0x00,0x00},/*"g",71*/ {0x10,0x04,0x1F,0xFC,0x00,0x84,0x01,0x00,0x01,0x00,0x01,0x04,0x00,0xFC,0x00,0x04},/*"h",72*/ {0x00,0x00,0x01,0x04,0x19,0x04,0x19,0xFC,0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x00},/*"i",73*/ {0x00,0x00,0x00,0x03,0x00,0x01,0x01,0x01,0x19,0x01,0x19,0xFE,0x00,0x00,0x00,0x00},/*"j",74*/ {0x10,0x04,0x1F,0xFC,0x00,0x24,0x00,0x40,0x01,0xB4,0x01,0x0C,0x01,0x04,0x00,0x00},/*"k",75*/ {0x00,0x00,0x10,0x04,0x10,0x04,0x1F,0xFC,0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x00},/*"l",76*/ {0x01,0x04,0x01,0xFC,0x01,0x04,0x01,0x00,0x01,0xFC,0x01,0x04,0x01,0x00,0x00,0xFC},/*"m",77*/ {0x01,0x04,0x01,0xFC,0x00,0x84,0x01,0x00,0x01,0x00,0x01,0x04,0x00,0xFC,0x00,0x04},/*"n",78*/{0x01,0x01,0x01,0xFF,0x00,0x85,0x01,0x04,0x01,0x04,0x00,0x88,0x00,0x70,0x00,0x00},/*"p",80*/ {0x00,0x00,0x00,0x70,0x00,0x88,0x01,0x04,0x01,0x04,0x01,0x05,0x01,0xFF,0x00,0x01},/*"q",81*/ {0x01,0x04,0x01,0x04,0x01,0xFC,0x00,0x84,0x01,0x04,0x01,0x00,0x01,0x80,0x00,0x00},/*"r",82*/ {0x00,0x00,0x00,0xCC,0x01,0x24,0x01,0x24,0x01,0x24,0x01,0x24,0x01,0x98,0x00,0x00},/*"s",83*/ {0x00,0x00,0x01,0x00,0x01,0x00,0x07,0xF8,0x01,0x04,0x01,0x04,0x00,0x00,0x00,0x00},/*"t",84*/ {0x01,0x00,0x01,0xF8,0x00,0x04,0x00,0x04,0x00,0x04,0x01,0x08,0x01,0xFC,0x00,0x04},/*"u",85*/ {0x01,0x00,0x01,0x80,0x01,0x70,0x00,0x0C,0x00,0x10,0x01,0x60,0x01,0x80,0x01,0x00},/*"v",86*/ {0x01,0xF0,0x01,0x0C,0x00,0x30,0x01,0xC0,0x00,0x30,0x01,0x0C,0x01,0xF0,0x01,0x00},/*"w",87*/ {0x00,0x00,0x01,0x04,0x01,0x8C,0x00,0x74,0x01,0x70,0x01,0x8C,0x01,0x04,0x00,0x00},/*"x",88*/ {0x01,0x01,0x01,0x81,0x01,0x71,0x00,0x0E,0x00,0x18,0x01,0x60,0x01,0x80,0x01,0x00},/*"y",89*/ {0x00,0x00,0x01,0x84,0x01,0x0C,0x01,0x34,0x01,0x44,0x01,0x84,0x01,0x0C,0x00,0x00},/*"z",90*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x3E,0xFC,0x40,0x02,0x40,0x02},/*"{",91*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00},/*"|",92*/ {0x00,0x00,0x40,0x02,0x40,0x02,0x3E,0xFC,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"}",93*/ {0x00,0x00,0x60,0x00,0x80,0x00,0x80,0x00,0x40,0x00,0x40,0x00,0x20,0x00,0x20,0x00},/*"~",94*/ };static u8 fac_us=0; //us延时倍乘数static u16 fac_ms=0; //ms延时倍乘数void delay_init(u8 SYSCLK){SysTick->CTRL&=0xfffffffb; //bit2清空,选择外部时钟 HCLK/8fac_us=SYSCLK/8;fac_ms=(u16)fac_us*1000;}void delay_ms(u16 nms){u32 temp;SysTick->LOAD=(u32)nms*fac_ms; //时间加载(SysTick->LOAD为24bit)SysTick->VAL =0x00; //清空计数器SysTick->CTRL=0x01 ; //开始倒数do{temp=SysTick->CTRL;}while(temp&0x01&&!(temp&(1<<16))); //等待时间到达SysTick->CTRL=0x00; //关闭计数器SysTick->VAL =0X00; //清空计数器}void delay_us(u32 nus){u32 temp;SysTick->LOAD=nus*fac_us; //时间加载SysTick->VAL=0x00; //清空计数器SysTick->CTRL=0x01 ; //开始倒数do{temp=SysTick->CTRL;}while(temp&0x01&&!(temp&(1<<16))); //等待时间到达SysTick->CTRL=0x00; //关闭计数器SysTick->VAL =0X00; //清空计数器}void OLED_Refresh_Gram(void){u8 i,n;for(i=0;i<8;i++){OLED_WR_Byte (0xb0+i,OLED_CMD); //设置页地址(0~7)OLED_WR_Byte (0x00,OLED_CMD); //设置显示位置—列低地址 OLED_WR_Byte (0x10,OLED_CMD); //设置显示位置—列高地址 for(n=0;n<128;n++){OLED_WR_Byte(OLED_GRAM[n][i],OLED_DATA);}}}void OLED_WR_Byte(u8 dat,u8 cmd){u8 i;if(cmd){OLED_RS_Set();}else{OLED_RS_Clr();}for(i=0;i<8;i++){OLED_SCLK_Clr();if(dat&0x80){OLED_SDIN_Set();}else{OLED_SDIN_Clr();}OLED_SCLK_Set();dat<<=1;}OLED_RS_Set();}void OLED_Display_On(void){OLED_WR_Byte(0X8D,OLED_CMD); //SET DCDC命令OLED_WR_Byte(0X14,OLED_CMD); //DCDC ONOLED_WR_Byte(0XAF,OLED_CMD); //DISPLAY ON}void OLED_Display_Off(void){OLED_WR_Byte(0X8D,OLED_CMD); //SET DCDC命令OLED_WR_Byte(0X10,OLED_CMD); //DCDC OFFOLED_WR_Byte(0XAE,OLED_CMD); //DISPLAY OFF}void OLED_Clear(void){u8 i,n;for(i=0;i<8;i++)for(n=0;n<128;n++)OLED_GRAM[n][i]=0X00; OLED_Refresh_Gram(); //更新显示}void OLED_DrawPoint(u8 x,u8 y,u8 t){u8 pos,bx,temp=0;if(x>127||y>63)return; //超出范围了.pos=7-y/8;bx=y%8;temp=1<<(7-bx);if(t)OLED_GRAM[x][pos]|=temp;else OLED_GRAM[x][pos]&=~temp;}void OLED_ShowChar(u8 x,u8 y,u8 chr,u8 size,u8 mode){u8 temp,t,t1;u8 y0=y;chr=chr-' '; //得到偏移后的值 for(t=0;t<size;t++){if(size==12) //调用1206字体{temp=oled_asc2_1206[chr][t];}else //调用1608字体{temp=oled_asc2_1608[chr][t];}for(t1=0;t1<8;t1++){if(temp&0x80){OLED_DrawPoint(x,y,mode);}else{OLED_DrawPoint(x,y,!mode);}temp<<=1;y++;if((y-y0)==size){y=y0;x++;break;}}}}u32 oled_pow(u8 m,u8 n){u32 result=1;while(n--)result*=m;return result;}void OLED_ShowNumber(u8 x,u8 y,u32 num,u8 len,u8 size) {u8 t,temp;u8 enshow=0;for(t=0;t<len;t++){temp=(num/oled_pow(10,len-t-1))%10;if(enshow==0&&t<(len-1)){if(temp==0){OLED_ShowChar(x+(size/2)*t,y,' ',size,1);continue;} else{enshow=1;}}OLED_ShowChar(x+(size/2)*t,y,temp+'0',size,1);}}void OLED_ShowString(u8 x,u8 y,const u8 *p){#define MAX_CHAR_POSX 122#define MAX_CHAR_POSY 58while(*p!='\0'){if(x>MAX_CHAR_POSX){x=0;y+=16;}if(y>MAX_CHAR_POSY){y=x=0;OLED_Clear();}OLED_ShowChar(x,y,*p,12,1);x+=8;p++;}}void Oled_Init(void){RCC->APB2ENR|=1<<3; //使能PORTB时钟GPIOB->CRL&=0XFFF0FFFF;GPIOB->CRL|=0X00020000; //PB4 推挽输出RCC->APB2ENR|=1<<4; //使能PORTC时钟RCC->APB2ENR|=1<<0; //使能AFIO时钟GPIOC->CRH&=0X000FFFFF; //PC13,14,15设置成输出 2MHz 推挽输出GPIOC->CRH|=0X22200000;PWR->CR|=1<<8; //取消备份区写保护RCC->BDCR&=0xFFFFFFFE; //外部低俗振荡器关闭 PC14,PC15成为普通IOBKP->CR&=0xFFFFFFFE; //侵入检测TAMPER引脚作为通用IO口使用PWR->CR&=0xFFFFFEFF; //备份区写保护OLED_RST_Clr();delay_ms(100);OLED_RST_Set();OLED_WR_Byte(0xAE,OLED_CMD); //关闭显示OLED_WR_Byte(0xD5,OLED_CMD); //设置时钟分频因子,震荡频率OLED_WR_Byte(80,OLED_CMD); //[3:0],分频因子;[7:4],震荡频率OLED_WR_Byte(0xA8,OLED_CMD); //设置驱动路数OLED_WR_Byte(0X3F,OLED_CMD); //默认0X3F(1/64)OLED_WR_Byte(0xD3,OLED_CMD); //设置显示偏移OLED_WR_Byte(0X00,OLED_CMD); //默认为0OLED_WR_Byte(0x40,OLED_CMD); //设置显示开始行 [5:0],行数.OLED_WR_Byte(0x8D,OLED_CMD); //电荷泵设置OLED_WR_Byte(0x14,OLED_CMD); //bit2,开启/关闭OLED_WR_Byte(0x20,OLED_CMD); //设置内存地址模式OLED_WR_Byte(0x02,OLED_CMD); //[1:0],00,列地址模式;01,行地址模式;10,页地址模式;默认10;OLED_WR_Byte(0xA1,OLED_CMD); //段重定义设置,bit0:0,0->0;1,0->127;OLED_WR_Byte(0xC0,OLED_CMD); //设置COM扫描方向;bit3:0,普通模式;1,重定义模式 COM[N-1]->COM0;N:驱动路数OLED_WR_Byte(0xDA,OLED_CMD); //设置COM硬件引脚配置OLED_WR_Byte(0x12,OLED_CMD); //[5:4]配置OLED_WR_Byte(0x81,OLED_CMD); //对比度设置OLED_WR_Byte(0xEF,OLED_CMD); //1~255;默认0X7F (亮度设置,越大越亮)OLED_WR_Byte(0xD9,OLED_CMD); //设置预充电周期OLED_WR_Byte(0xf1,OLED_CMD); //[3:0],PHASE 1;[7:4],PHASE 2;OLED_WR_Byte(0xDB,OLED_CMD); //设置VCOMH 电压倍率OLED_WR_Byte(0x30,OLED_CMD); //[6:4]000,0.65*vcc;001,0.77*vcc;011,0.83*vcc;OLED_WR_Byte(0xA4,OLED_CMD); //全局显示开启;bit0:1,开启;0,关闭;(白屏/黑屏)OLED_WR_Byte(0xA6,OLED_CMD); //设置显示方式;bit0:1,反相显示;0,正常显示OLED_WR_Byte(0xAF,OLED_CMD); //开启显示OLED_Clear();}void Oled_Show(void){OLED_ShowString(0,0,"****************");OLED_ShowString(30,20,"OLED-TEST");OLED_ShowString(5,30,"YOU ARE WELCOME");OLED_ShowString(0,50,"****************");OLED_Refresh_Gram();}int main(void){Stm32_Clock_Init(9); //系统时钟设置delay_init(72); //延时初始化JTAG_Set(JTAG_SWD_DISABLE); //关闭JTAG接口JTAG_Set(SWD_ENABLE); //打开SWD接口Oled_Init();while(1){Oled_Show();}}。
OLED模块使用说明
7.6 系统显示设计控制系统显示常用的显示器件有数码管、LCD、OLED等。
OLED即有机发光二极管(Organic Light Emitting Diode),其同时具备自发光,不需背光源、对比度高、制程较简单等优异之特性,被认为是下一代的平面显示器新兴应用技术。
本节主要介绍OLED的工作原理、底层驱动代码编写以及如何通过取模软件显示任何自己想要显示的文字或者图片。
7.6.1 OLED显示原理如图4所示为0.96寸OLED显示模块,其分辨率为128*64,采用4线SPI接口方式,模块的接口定义如表1所示。
图4 0.96寸OLED显示模块种并行接口方式、3线或4线SPI接口方式、IIC接口方式。
这里介绍OLED模块4线SPI 通信方式,只需4根通信线就能实现对OLED模块的显示控制,这4根线为:D0、D1、DC、CS。
如图5所示为4线SPI写操作时序图,在4线SPI模式下,每个数据长度均为8位,也即为1个字节。
每次发送该字节数据前,如果该字节数据为指令号,则将DC管脚拉低;如果该字节数据为普通数据,则将DC管脚置高。
在SCLK上升沿,数据从SDIN移入SSD1306,并且高位在前。
SSD1306的显存总共为128*64bit大小,SSD1306将这些显存分为8页,其对应关系如表2所示。
可见OLED水平像素分为128段,即SEG0~SEG127;垂直像素平分为8页,也即垂直方向每8个像素点为1页。
从而可见,在确定显示的位置后,通过往显存中写入一个字节数据,则相应的SEG将按照数据进行显示,位数据为1时,相应像素点被点亮,位数据为0时,相应的像素点熄灭。
图5 4线SPI写操作时序图令较多,具体的可以参考相关手册,这里介绍如表3所示几个比较常用的指令。
命令,随后发送的一个字节为要设置的对比度的值。
这个值设置得越大屏幕就越亮。
第二个命令为 0XAE/0XAF。
0XAE 为关闭显示命令; 0XAF 为开启显示命令。
0.96寸OLED点亮原理,通过对驱动芯片的设置,实现OLED的点亮,C语言例程,
光,而且 OLED 显示屏幕可视角度大,并且能够节省电能。OLED 由于同时具备自发光、 不需背光源、对比度高、厚度薄、视角广、反应速度快、可用于挠曲面板、使用温度范围广、
结构及制程简单等优异之特性,被认为下一代平面显示器新兴应用技术。
最先接触的 12864 屏都是 LCD 的,需要背光,功耗较高,而 OLED 的功耗低,更加适 合小系统;由于两者发光材料的不同,在不同的环境中,OLED 的显示效果更佳。更D(带字库)
使用手册 V1.1
YFRobot 荣誉出品 2016 年 08 月 01 日
版权声明
本手册版权归 YFRobot 工作室(以下简称“YFRobot”)所有,对该手册保留一切权力, 非经 YFRobot 授权同意(书面形式),任何单位及个人不得擅自摘录本手册部分及全部内 容用于商业用途,违者将追究其法律责任。可以在网上传播,以方便更多人,但必须保证手 册的完整性。
2.1 取模.................................................................................................................................... 2 2.2 显示部分............................................................................................................................ 5 2.3 驱动芯片 SSD1306........................................................................................................... 6 2.4 GT20L16S1Y 字库芯片....................................................................................................8 3 通讯方式..................................................................................................................................... 11 3.1 SSD1306 通讯..................................................................................................................11 3.2 GT20L16S1Y 通讯..........................................................................................................12 4 连接方式..................................................................................................................................... 15 5 程序设计..................................................................................................................................... 17 附录 A:更新说明........................................................................................................................... 24 附录 B:联系方式........................................................................................................................... 25
中景园电子0.96寸OLED使用文档新手必看V2.0
0.96寸OLED显示屏使用手册一、OLED简介OLED,即有机发光二极管(Organic Light Emitting Diode)。
OLED 由于同时具备自发光,不需背光源、对比度高、厚度薄、视角广、反应速度快、可用于挠曲性面板、使用温度范围广、构造及制程较简单等优异之特性,被认为是下一代的平面显示器新兴应用技术。
LCD 都需要背光,而OLED不需要,因为它是自发光的。
这样同样的显示OLED效果要来得好一些。
以目前的技术,OLED 的尺寸还难以大型化,但是分辨率确可以做到很高。
在此我们使用的是中景园电子的0.96寸OLED显示屏,该屏有以下特点:1)0.96寸OLED有黄蓝,白,蓝三种颜色可选;其中黄蓝是屏上1/4部分为黄光,下3/4为蓝;而且是固定区域显示固定颜色,颜色和显示区域均不能修改;白光则为纯白,也就是黑底白字;蓝色则为纯蓝,也就是黑底蓝字。
2)分辨率为128*643)多种接口方式;OLED裸屏总共种接口包括:6800、8080 两种并行接口方式、3线或4 线的串行SPI 接口方式、IIC 接口方式(只需要 2 根线就可以控制OLED 了!),这五种接口是通过屏上的BS0~BS2来配置的。
4)中景园电子的本屏开发了两种接口的Demo板,接口分别为七针的SPI/IIC兼容模块,四针的IIC模块。
两种模块都很方便使用;希望大家根据实际需求来选择不同的模块。
二、产品特点2.1 0.96寸OLED裸屏外观裸屏为30pin,从屏正面看左下角为1,右下角为30;在设计的时候一定要注意不要搞反了。
具体的接口定义请大家查看0.96寸OLED官方数据手册;里面有详细介绍。
2.2 0.96寸OLED模块2.2.1 SPI/IIC接口模块模块接口定义:1.GND 电源地2.VCC 电源正(3~5.5V)3.D0 OLED的D0脚,在SPI和IIC通信中为时钟管脚4.D1 OLED的D1脚,在SPI和IIC通信中为数据管脚5.RES OLED的RES#脚,用来复位(低电平复位)6.DC OLED的D/C#E脚,数据和命令控制管脚7.CS OLED的CS#脚,也就是片选管脚2.2.2 IIC接口模块1.GND 电源地2.VCC 电源正(3~5.5V)3.SCL OLED的D0脚,在IIC通信中为时钟管脚4.SDA OLED的D1脚,在IIC通信中为数据管脚2.3 0.96寸OLED驱动IC本屏所用的驱动IC为SSD1306;其具有内部升压功能;所以在设计的时候不需要再专一设计升压电路;当然了本屏也可以选用外部升压,具体的请详查数据手册。
0.96寸OLED显示屏STM32F103C8T6IIC驱动程序
0.96⼨OLED显⽰屏STM32F103C8T6IIC驱动程序0.96⼨OLED显⽰屏的IIC驱动程序有很多现成的⽰例,但⼤部分编程风格实在是让程序阅读起来很困难,所以本伽椰⼦重新梳理了⼀下驱动程序,使得其更⽅便阅读,具体代码内容如下:1、滴答时钟DRIVE_SYSTICK.h1 #ifndef _DRIVE_SYSTICK_H_2#define _DRIVE_SYSTICK_H_3 #include "stm32f10x.h"45void LibDriveSystickInit(void);6void LibDriveSystickDelay_us(uint32_t Dus);7void LibDriveSystickDelay_ms(uint32_t Dms);8#endifDRIVE_SYSTICK.c1 #include "DRIVE_SYSTICK.h"234/*************************************************5函数名称 : LibDriveSystickInit6功能描述 : 滴答时钟初始化7被调⽤清单 : ⽆8调⽤清单 :9输⼊参数 : ⽆10输出参数 : ⽆11返回参数 : ⽆12其他 : ⽆13*************************************************/14void LibDriveSystickInit(void)15 {16 SysTick->LOAD = 1000;17 SysTick->VAL = 0;18 SysTick->CTRL = 0;19 }2021/*************************************************22函数名称 : LibDriveSystickDelay_us23功能描述 : 滴答时钟微妙级延时24被调⽤清单 : ⽆25调⽤清单 :26输⼊参数 : dus待延时微妙数27输出参数 : ⽆28返回参数 : ⽆29其他 : ⽆30*************************************************/31void LibDriveSystickDelay_us(uint32_t Dus)32 {33if((Dus == 0) || (Dus > 700000))34 {35return;36 }37 SysTick->LOAD = Dus*22-1;38 SysTick->VAL = 0;39 SysTick->CTRL |= 1;4041while((SysTick->CTRL & (1<<16)) == 0);42 SysTick->CTRL = 0;43 }4445/*************************************************46函数名称 : LibDriveSystickDelay_ms47功能描述 :滴答时钟毫秒级延时48被调⽤清单 : ⽆49调⽤清单 :50输⼊参数 : dms待延时毫秒数51输出参数 : ⽆52返回参数 : ⽆53其他 : ⽆54*************************************************/55void LibDriveSystickDelay_ms(uint32_t Dms)56 {57while(Dms >= 700)58 {59 LibDriveSystickDelay_us(700000);60 Dms -= 700;61 }62if(Dms < 700)63 {64 LibDriveSystickDelay_us(Dms*1000);65 }66 }APP_SYSTICK.h1 #ifndef _APP_SYSTICK_H_2#define _APP_SYSTICK_H_3 #include "DRIVE_SYSTICK.h"45void FunAppSystickInit(void);67#endifAPP_SYSTICK.c1 #include "APP_SYSTICK.h"23/*************************************************4函数名称 : FunAppOledDisplayTurn5功能描述 : 屏幕旋转180°6被调⽤清单 : ⽆7调⽤清单 :8输⼊参数 : Mode == 0正常显⽰ Mode == 1反转显⽰9输出参数 : ⽆10返回参数 : ⽆11其他 : ⽆12*************************************************/13void FunAppSystickInit(void)14 {15 LibDriveSystickInit();16 }2、IIC通讯驱动程序DRIVE_I2C2.h1 #ifndef _DRIVE_I2C2_H_2#define _DRIVE_I2C2_H_3 #include "stm32f10x.h"4 #include "DRIVE_SYSTICK.h"56#define SDA_H GPIO_SetBits(GPIOB, GPIO_Pin_11)7#define SDA_L GPIO_ResetBits(GPIOB, GPIO_Pin_11)8#define SCL_H GPIO_SetBits(GPIOB, GPIO_Pin_10)9#define SCL_L GPIO_ResetBits(GPIOB, GPIO_Pin_10)10#define SDA_IN GPIO_ReadInputDataBit(GPIOB, GPIO_Pin_11)1112void LibDriveI2c2Init(void);13void LibDriveI2c2Start(void);14void LibDriveI2c2Stop(void);15void LibDriveI2c2SendAck(uint8_t Ack);16void LibDriveI2c2WriteByte(uint8_t Data);17 uint8_t LibDriveI2c2Read(void);18 uint8_t LibDriveI2c2CheckAck(void);1920#endifDRIVE_I2C2.c1 #include "DRIVE_I2C2.h"23/*************************************************4函数名称 : LibDriveI2c2Init5功能描述 : I2C2初始化6被调⽤清单 : ⽆7调⽤清单 :8输⼊参数 : ⽆9输出参数 : ⽆10返回参数 : ⽆11其他 : ⽆12*************************************************/13void LibDriveI2c2Init(void)14 {15 GPIO_InitTypeDef GPIO_InitStruct;16 RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE); 1718 GPIO_InitStruct.GPIO_Mode = GPIO_Mode_Out_PP;19 GPIO_InitStruct.GPIO_Pin = GPIO_Pin_10 | GPIO_Pin_11;20 GPIO_InitStruct.GPIO_Speed= GPIO_Speed_50MHz;21 GPIO_Init(GPIOB, &GPIO_InitStruct);22 }2324/*************************************************25函数名称 : LibDriveI2c2Start26功能描述 : I2C2开始信号27被调⽤清单 : ⽆28调⽤清单 :29输⼊参数 : ⽆30输出参数 : ⽆31返回参数 : ⽆32其他 : ⽆33*************************************************/34void LibDriveI2c2Start(void)35 {36 SCL_L;37 SDA_H;3839 SCL_H;40 LibDriveSystickDelay_us(5);41 SDA_L;42 LibDriveSystickDelay_us(5);43 SCL_L;44 }4546/*************************************************47函数名称 : LibDriveI2c2Stop48功能描述 : I2C2停⽌信号49被调⽤清单 : ⽆50调⽤清单 :51输⼊参数 : ⽆52输出参数 : ⽆53返回参数 : ⽆54其他 : ⽆55*************************************************/56void LibDriveI2c2Stop(void)57 {58 SCL_L;59 SDA_L;6061 SCL_H;62 LibDriveSystickDelay_us(5);63 SDA_H;64 LibDriveSystickDelay_us(5);65 }6667/*************************************************68函数名称 : LibDriveI2c2SendAck69功能描述 : I2C2发送回复70被调⽤清单 : ⽆71调⽤清单 :72输⼊参数 : Ack 回复状态73输出参数 : ⽆74返回参数 : ⽆75其他 : ⽆76*************************************************/77void LibDriveI2c2SendAck(uint8_t Ack)78 {79if (Ack) //不应答80 {81 SCL_L;82 LibDriveSystickDelay_us(5);83 SDA_H;84 LibDriveSystickDelay_us(1);85 SCL_H;86 LibDriveSystickDelay_us(5);87 }88else if (Ack == 0) //应答89 {90 SCL_L;91 LibDriveSystickDelay_us(5);92 SDA_L;93 LibDriveSystickDelay_us(1);94 SCL_H;95 LibDriveSystickDelay_us(5);96 }97 SCL_L;98 }99100/*************************************************101函数名称 : LibDriveI2c2WriteByte102功能描述 : I2C2写⼀个字节103被调⽤清单 : ⽆104调⽤清单 :105输⼊参数 : Data 待发送数据106输出参数 : ⽆107返回参数 : ⽆108其他 : ⽆109*************************************************/110void LibDriveI2c2WriteByte(uint8_t Data)111 {112 uint8_t localIte = 0;113for (localIte = 0; localIte < 8; localIte++)114 {115 SCL_L; //可以改变数据线116 LibDriveSystickDelay_us(5);117if (Data & 0x80)118 {119 SDA_H;120 }121else122 {123 SDA_L;124 }125 LibDriveSystickDelay_us(1);126 SCL_H; //从机时钟线拉⾼从机才可以读此位数据127 LibDriveSystickDelay_us(5);128 Data = Data << 1;129 }130 SCL_L; //安全131 }132133/*************************************************134函数名称 : LibDriveI2c2Read135功能描述 : I2C2读取数据136被调⽤清单 : ⽆137调⽤清单 :138输⼊参数 : ⽆139输出参数 : ⽆140返回参数 : 所读取到的数据(⼀个字节)141其他 : ⽆142*************************************************/143 uint8_t LibDriveI2c2Read(void)144 {145 uint8_t localData = 0;146 uint8_t localIte = 0;147148/*把数线的模式改为输⼊模式*/149 SCL_L; //可以改变数据线150 SDA_H; //输⼊模式151152/*接收⼋位数据*/153for (localIte = 0; localIte < 8; localIte++)154 {155 SCL_L; //拉低时钟线,从机发送⼀个位数据156 LibDriveSystickDelay_us(5);157 SCL_H; //主机读158 LibDriveSystickDelay_us(5);159 localData = localData << 1;160if (SDA_IN)161 {162 localData = localData | 0x01;163 }164 }165 SCL_L; //安全166return localData;167 }168169/*************************************************170函数名称 : LibDriveI2c2CheckAck171功能描述 : I2C2检查回复状态172被调⽤清单 : ⽆173调⽤清单 :174输⼊参数 : ⽆175输出参数 : ⽆176返回参数 : 应答返回1 ⽆应答放回0177其他 : ⽆178*************************************************/179 uint8_t LibDriveI2c2CheckAck(void)180 {181 uint8_t Ack = 0;182/*将数据线的模式改变为输⼊模式*/183 SCL_L;184 SDA_H;185/*检测应答位信号*/186 SCL_L; //从机可以发送应答信号/不应答信号187 LibDriveSystickDelay_us(5);188189 SCL_H; //主机可以读应答信号190 LibDriveSystickDelay_us(5);191if (SDA_IN) //应答192 {193 Ack = 1;194 }195 SCL_L; //安全196return Ack;197 }3、OLED驱动程序APP_OLED.h1 #ifndef _APP_OLED_H_2#define _APP_OLED_H_3 #include "DRIVE_I2C2.h"4 #include <stdlib.h>56#define OLED_CMD 0//写命令7#define OLED_DATA 1//写数据89void FunAppOledInit(void);10void FunAppOledWriteByte(uint8_t Data, uint8_t Mode);11void FunAppOledDisPlayOn(void);12void FunAppOledDisPlayOff(void);13void FunAppOledClear(void);14void FunAppOledRefresh(void);15void FunAppOledDrawPoint(uint8_t X, uint8_t Y);16void FunAppOledClearPoint(uint8_t X, uint8_t Y);17void FunAppOledDrawLine(uint8_t X1, uint8_t Y1, uint8_t X2, uint8_t Y2);18void FunAppOledDrawCircle(uint8_t X, uint8_t Y, uint8_t R);19void FunAppOledShowChar(uint8_t X, uint8_t Y, uint8_t Chr, uint8_t Size); 20void FunAppOledShowString(uint8_t X, uint8_t Y, uint8_t * Chr, uint8_t Size);21void FunAppOledShowNum(uint8_t X, uint8_t Y, uint32_t Num, uint8_t Len, uint8_t Size);22void FunAppOledShowChinese(uint8_t X, uint8_t Y, uint8_t Num, uint8_t Size);23void FunAppOledScrollDisplay(uint8_t Num, uint8_t Space);24void FunAppOledWriteBP(uint8_t X, uint8_t Y);25void FunAppOledShowPicture(uint8_t X1, uint8_t Y1, uint8_t X2, uint8_t Y2, uint8_t *Bmp);26void FunAppOledColorTurn(uint8_t Mode);27void FunAppOledDisplayTurn(uint8_t Mode);28 uint32_t FunAppOledPow(uint8_t Num, uint8_t Index);29#endifAPP_OLED.c1 #include "APP_OLED.h"2 #include "OLED_FONT.h"34static uint8_t OLED_GRAM[144][8];56/*************************************************7函数名称 : FunAppOledInit8功能描述 : OLED初始化9被调⽤清单 : ⽆10调⽤清单 :11输⼊参数 : ⽆12输出参数 : ⽆13返回参数 : ⽆14其他 : ⽆15*************************************************/16void FunAppOledInit(void)17 {18 LibDriveI2c2Init();19 LibDriveSystickDelay_ms(100);20 FunAppOledWriteByte(0xAE,OLED_CMD);//--turn off oled panel21 FunAppOledWriteByte(0x00,OLED_CMD);//---set low column address22 FunAppOledWriteByte(0x10,OLED_CMD);//---set high column address23 FunAppOledWriteByte(0x40,OLED_CMD);//--set start line address Set Mapping RAM Display Start Line (0x00~0x3F)24 FunAppOledWriteByte(0x81,OLED_CMD);//--set contrast control register25 FunAppOledWriteByte(0xCF,OLED_CMD);// Set SEG Output Current Brightness26 FunAppOledWriteByte(0xA1,OLED_CMD);//--Set SEG/Column Mapping 0xa0左右反置 0xa1正常27 FunAppOledWriteByte(0xC8,OLED_CMD);//Set COM/Row Scan Direction 0xc0上下反置 0xc8正常28 FunAppOledWriteByte(0xA6,OLED_CMD);//--set normal display29 FunAppOledWriteByte(0xA8,OLED_CMD);//--set multiplex ratio(1 to 64)30 FunAppOledWriteByte(0x3f,OLED_CMD);//--1/64 duty31 FunAppOledWriteByte(0xD3,OLED_CMD);//-set display offset Shift Mapping RAM Counter (0x00~0x3F)32 FunAppOledWriteByte(0x00,OLED_CMD);//-not offset33 FunAppOledWriteByte(0xd5,OLED_CMD);//--set display clock divide ratio/oscillator frequency34 FunAppOledWriteByte(0x80,OLED_CMD);//--set divide ratio, Set Clock as 100 Frames/Sec35 FunAppOledWriteByte(0xD9,OLED_CMD);//--set pre-charge period36 FunAppOledWriteByte(0xF1,OLED_CMD);//Set Pre-Charge as 15 Clocks & Discharge as 1 Clock37 FunAppOledWriteByte(0xDA,OLED_CMD);//--set com pins hardware configuration38 FunAppOledWriteByte(0x12,OLED_CMD);39 FunAppOledWriteByte(0xDB,OLED_CMD);//--set vcomh40 FunAppOledWriteByte(0x40,OLED_CMD);//Set VCOM Deselect Level41 FunAppOledWriteByte(0x20,OLED_CMD);//-Set Page Addressing Mode (0x00/0x01/0x02)42 FunAppOledWriteByte(0x02,OLED_CMD);//43 FunAppOledWriteByte(0x8D,OLED_CMD);//--set Charge Pump enable/disable44 FunAppOledWriteByte(0x14,OLED_CMD);//--set(0x10) disable45 FunAppOledWriteByte(0xA4,OLED_CMD);// Disable Entire Display On (0xa4/0xa5)46 FunAppOledWriteByte(0xA6,OLED_CMD);// Disable Inverse Display On (0xa6/a7)47 FunAppOledWriteByte(0xAF,OLED_CMD);48 FunAppOledClear();49 }5051/*************************************************52函数名称 : FunAppOledWriteByte53功能描述 : OLED写⼊⼀字节54被调⽤清单 : ⽆55调⽤清单 :56输⼊参数 : Data待写⼊数据,Mode数据写⼊模式,为0为写指令为1为写数据57输出参数 : ⽆58返回参数 : ⽆59其他 : ⽆60*************************************************/61void FunAppOledWriteByte(uint8_t Data, uint8_t Mode)62 {63 uint8_t localAck = 0;64 LibDriveI2c2Start();65 LibDriveI2c2WriteByte(0x78);66 localAck = LibDriveI2c2CheckAck();67if(localAck)68 {69 LibDriveI2c2Stop();70 }71if(Mode)72 {73 LibDriveI2c2WriteByte(0x40);74 }75else76 {77 LibDriveI2c2WriteByte(0x00);78 }7980 localAck = LibDriveI2c2CheckAck();81if(localAck)82 {83 LibDriveI2c2Stop();84 }85 LibDriveI2c2WriteByte(Data);8687 localAck = LibDriveI2c2CheckAck();88if(localAck)89 {90 LibDriveI2c2Stop();91 }92 LibDriveI2c2Stop();93 }9495/*************************************************96函数名称 : FunAppOledDisPlayOn97功能描述 : 开启OLED显⽰98被调⽤清单 : ⽆99调⽤清单 :100输⼊参数 : ⽆101输出参数 : ⽆102返回参数 : ⽆103其他 : ⽆104*************************************************/105void FunAppOledDisPlayOn(void)106 {107 FunAppOledWriteByte(0x8D, OLED_CMD);//电荷泵使能108 FunAppOledWriteByte(0x14, OLED_CMD);//开启电荷泵109 FunAppOledWriteByte(0xAE, OLED_CMD);//点亮屏幕110 }111112/*************************************************113函数名称 : FunAppOledDisPlayOn114功能描述 : 关闭OLED显⽰115被调⽤清单 : ⽆116调⽤清单 :117输⼊参数 : ⽆118输出参数 : ⽆119返回参数 : ⽆120其他 : ⽆121*************************************************/122void FunAppOledDisPlayOff(void)123 {124 FunAppOledWriteByte(0x8D, OLED_CMD);//电荷泵使能125 FunAppOledWriteByte(0x10, OLED_CMD);//关闭电荷泵126 FunAppOledWriteByte(0xAF, OLED_CMD);//关闭屏幕127 }128129/*************************************************130函数名称 : FunAppOledRefresh131功能描述 : 更新显⽰132被调⽤清单 : ⽆133调⽤清单 :134输⼊参数 : ⽆135输出参数 : ⽆136返回参数 : ⽆137其他 : ⽆138*************************************************/139void FunAppOledRefresh(void)140 {141 uint8_t localIte = 0;142 uint8_t localNum = 0;143144for (localIte = 0; localIte < 8; localIte++)145 {146 FunAppOledWriteByte(0xB0 + localIte, OLED_CMD);147 FunAppOledWriteByte(0x00 , OLED_CMD);148 FunAppOledWriteByte(0x10 , OLED_CMD);149for (localNum = 0; localNum < 128; localNum++)150 {151 FunAppOledWriteByte(OLED_GRAM[localNum][localIte], OLED_DATA); 152 }153 }154 }155156/*************************************************157函数名称 : FunAppOledClear158功能描述 : 清屏159被调⽤清单 : ⽆160调⽤清单 :161输⼊参数 : ⽆162输出参数 : ⽆163返回参数 : ⽆164其他 : ⽆165*************************************************/166void FunAppOledClear(void)167 {168 uint8_t localIte = 0;169 uint8_t localNum = 0;170171for (localIte = 0; localIte < 8; localIte++)172 {173for (localNum = 0; localNum < 128; localNum++)174 {175 OLED_GRAM[localNum][localIte] = 0;176 }177 }178 FunAppOledRefresh();179 }180181/*************************************************182函数名称 : FunAppOledDrawPoint183功能描述 : 画点184被调⽤清单 : ⽆185调⽤清单 :186输⼊参数 : X(0 ~ 127) , Y(0 ~ 63)187输出参数 : ⽆188返回参数 : ⽆189其他 : ⽆190*************************************************/191void FunAppOledDrawPoint(uint8_t X, uint8_t Y)192 {193 uint8_t localI = 0;194 uint8_t localM = 0;195 uint8_t localN = 0;196197 localI = Y / 8;198 localM = Y % 8;199 localN = 1 << localM;200 OLED_GRAM[X][localI] |= localN;201 }202203/*************************************************204函数名称 : FunAppOledClearPoint205功能描述 : 清除⼀个点206被调⽤清单 : ⽆207调⽤清单 :208输⼊参数 : X(0 ~ 127) , Y(0 ~ 63)209输出参数 : ⽆210返回参数 : ⽆211其他 : ⽆212*************************************************/213void FunAppOledClearPoint(uint8_t X, uint8_t Y)214 {215 uint8_t localI = 0;216 uint8_t localM = 0;217 uint8_t localN = 0;218219 localI = Y / 8;220 localM = Y % 8;221 localN = 1 << localM;222223 OLED_GRAM[X][localI] = ~OLED_GRAM[X][localI];224 OLED_GRAM[X][localI] |= localN;225 OLED_GRAM[X][localI] = ~OLED_GRAM[X][localI];226 }227228/*************************************************229函数名称 : FunAppOledDrawLine230功能描述 : 画线231被调⽤清单 : ⽆232调⽤清单 :233输⼊参数 : X(0 ~ 127) , Y(0 ~ 63) (X1 , Y1)第⼀个点坐标(X2 , Y2)第⼆个点坐标234输出参数 : ⽆235返回参数 : ⽆236其他 : ⽆237*************************************************/238void FunAppOledDrawLine(uint8_t X1, uint8_t Y1, uint8_t X2, uint8_t Y2)239 {240 uint8_t localIte = 0;241 uint8_t localK0 = 0;242 uint8_t localK1 = 0;243 uint8_t localK2 = 0;244245if ((X2 > 128)|| (Y2 > 64) || (X1 > X2) || (Y1 > Y2))246 {247return ;248 }249250if (X1 == X2) //竖线251 {252for (localIte = 0; localIte < (Y2 - Y1); localIte++)253 {254 FunAppOledDrawPoint(X1, (Y1 + localIte));255 }256 }257else if (Y1 == Y2)//横线258 {259for (localIte = 0; localIte < (X2 - X1); localIte++)260 {261 FunAppOledDrawPoint((X1 + localIte), Y1);262 }263 }264else//斜线265 {266 localK0 = Y2 - Y1;267 localK1 = X2 - X1;268 localK2 = (localK0 * 10) / localK1;269for (localIte = 0; localIte < (X2 - X1); localIte++)270 {271 FunAppOledDrawPoint((X1 + localIte), (Y1 + ((localIte * localK2) / 10)));272 }273 }274 }275276/*************************************************277函数名称 : FunAppOledDrawCircle278功能描述 : 画圆279被调⽤清单 : ⽆280调⽤清单 :281输⼊参数 : X(0 ~ 127) , Y(0 ~ 63) (X , Y)圆⼼坐标 R半径282输出参数 : ⽆283返回参数 : ⽆284其他 : ⽆285*************************************************/286void FunAppOledDrawCircle(uint8_t X, uint8_t Y, uint8_t R)287 {288int localA = 0;289int localB = 0;290int localN = 0;291292 localB = R;293while((2 * localB * localB) >= (R * R))294 {295 FunAppOledDrawPoint(X + localA, Y - localB);296 FunAppOledDrawPoint(X - localA, Y - localB);297 FunAppOledDrawPoint(X - localA, Y + localB);298 FunAppOledDrawPoint(X + localA, Y + localB);299300 FunAppOledDrawPoint(X + localB, Y - localA);301 FunAppOledDrawPoint(X - localB, Y - localA);302 FunAppOledDrawPoint(X - localB, Y + localA);303 FunAppOledDrawPoint(X + localB, Y + localA);304305 localA++;306 localN = ((localA * localA) + (localB * localB)) - (R * R);//计算画的点离圆⼼的距离307if (localN > 0 )308 {309 localA--;310 localB--;311 }312 }313 }314315/*************************************************316函数名称 : FunAppOledShowChar317功能描述 : 显⽰⼀个字符318被调⽤清单 : ⽆319调⽤清单 :320输⼊参数 : X(0 ~ 127) , Y(0 ~ 63) (X , Y)起点坐标 Chr待显⽰字符 Size字体⼤⼩321输出参数 : ⽆322返回参数 : ⽆323其他 : ⽆324*************************************************/325void FunAppOledShowChar(uint8_t X, uint8_t Y, uint8_t Chr, uint8_t Size)326 {327 uint8_t localIte = 0;328 uint8_t localIte1 = 0;329 uint8_t localTemp = 0;330 uint8_t localSize = 0;331 uint8_t localChr = 0;332 uint8_t localY = 0;333334 localY = Y;335 localSize = ((Size / 8) + ((Size % 8) ? 1 : 0)) * (Size / 2);//得到字体⼀个字符对应点阵集所占字节数336 localChr = Chr - ''; //计算偏移后的值337for (localIte = 0; localIte < localSize; localIte++)338 {339if (Size == 12)340 {341 localTemp = asc2_1206[localChr][localIte];//调⽤1206字体342 }343else if (Size == 16)344 {345 localTemp = asc2_1608[localChr][localIte];//调⽤1608字体346 }347else if (Size == 24)348 {349 localTemp = asc2_2412[localChr][localIte];//调⽤2412字体350 }351else352 {353return ;354 }355356for (localIte1 = 0; localIte1 < 8; localIte1++)357 {358if (localTemp & 0x80)359 {360 FunAppOledDrawPoint(X, Y);361 }362else363 {364 FunAppOledClearPoint(X, Y);365 }366 localTemp <<= 1;367 Y++;368if ((Y - localY) == Size)369 {370 Y = localY;371 X++;372break;373 }374 }375 }376 }377378/*************************************************379函数名称 : FunAppOledShowString380功能描述 : 显⽰字符串381被调⽤清单 : ⽆382调⽤清单 :383输⼊参数 : X(0 ~ 127) , Y(0 ~ 63) (X , Y)起点坐标 Chr待显⽰字符串 Size字体⼤⼩384输出参数 : ⽆385返回参数 : ⽆386其他 : ⽆387*************************************************/388void FunAppOledShowString(uint8_t X, uint8_t Y, uint8_t * Chr, uint8_t Size)389 {390while((*Chr >= '') && (*Chr <= '~'))//判断是不是⾮法字符391 {392 FunAppOledShowChar(X, Y, *Chr, Size);393 X += Size / 2;394if (X > (128 - Size)) //换⾏395 {396 X = 0;397 Y += 2;398 }399 Chr++;400 }401 }402403/*************************************************404函数名称 : FunAppOledPow405功能描述 : 计算⼀个数据的次⽅406被调⽤清单 : ⽆407调⽤清单 :408输⼊参数 : Num底数,Index指数409输出参数 : ⽆410返回参数 : 计算后的值411其他 : ⽆412*************************************************/413 uint32_t FunAppOledPow(uint8_t Num, uint8_t Index)414 {415 uint32_t localRes = 1;416while(Index--)417 {418 localRes *= Num;419 }420return localRes;421 }422423/*************************************************424函数名称 : FunAppOledShowNum425功能描述 : 显⽰数字426被调⽤清单 : ⽆427调⽤清单 :428输⼊参数 : (X , Y)起点坐标 Len数字的位数 Size字体⼤⼩429输出参数 : ⽆430返回参数 : ⽆431其他 : ⽆432*************************************************/433void FunAppOledShowNum(uint8_t X, uint8_t Y, uint32_t Num, uint8_t Len, uint8_t Size) 434 {435 uint8_t localIte = 0;436 uint8_t localTemp = 0;437438for (localIte = 0; localIte < Len; localIte++)439 {440 localTemp = (Num / FunAppOledPow(10, Len - localIte - 1)) % 10;441if (localTemp == 0)442 {443 FunAppOledShowChar((X + (Size / 2) * localIte), Y, '0', Size);444 }445else446 {447 FunAppOledShowChar((X + (Size / 2) * localIte), Y, (localTemp + '0'), Size); 448 }449 }450 }451452/*************************************************453函数名称 : FunAppOledShowChinese454功能描述 : 显⽰汉字455被调⽤清单 : ⽆456调⽤清单 :457输⼊参数 : (X , Y)起点坐标 Num汉字对应序号 Size字体⼤⼩458输出参数 : ⽆459返回参数 : ⽆460其他 : ⽆461*************************************************/462void FunAppOledShowChinese(uint8_t X, uint8_t Y, uint8_t Num, uint8_t Size)463 {464 uint8_t localIte0 = 0;465 uint8_t localIte1 = 0;466 uint8_t localCount = 0;467 uint8_t localTemp = 0;468 uint8_t localChr = 0;469 uint8_t localX = 0;470 uint8_t localY = 0;471 uint8_t localSize = 0;472473 localX = X;474 localY = Y;475 localSize = Size / 8;476477while (localSize--)478 {479 localChr = (Num * Size / 8) + localCount;480 localCount++;481482for (localIte0 = 0; localIte0 < Size; localIte0++)483 {484if (Size == 16)485 {486 localTemp = Hzk0[localChr][localIte0]; //调⽤16*16字体487 }488else if (Size == 24)489 {490 localTemp = Hzk2[localChr][localIte0]; //调⽤24*24字体491 }492else if (Size == 32)493 {494 localTemp = Hzk3[localChr][localIte0]; //调⽤32*32字体495 }496else if (Size == 64)497 {498 localTemp = Hzk4[localChr][localIte0]; //调⽤64*64字体499 }500else501 {502return ;503 }504505for (localIte1 = 0; localIte1 < 8; localIte1++)506 {507if (localTemp & 0x01)508 {509 FunAppOledDrawPoint(X, Y);510 }511else512 {513 FunAppOledClearPoint(X, Y);514 }515 localTemp >>= 1;516 Y++;517 }518 X++;519if ((X - localX) == Size)520 {521 X = localX;522 localY = localY + 8;523 }524 Y = localY;525 }526 }527 }528529/*************************************************530函数名称 : FunAppOledScrollDisplay531功能描述 : 左移显⽰532被调⽤清单 : ⽆533调⽤清单 :534输⼊参数 : Num显⽰汉字的个数,Space每⼀遍显⽰的间隔535输出参数 : ⽆536返回参数 : ⽆537其他 : ⽆538*************************************************/539void FunAppOledScrollDisplay(uint8_t Num, uint8_t Space)540 {541 uint8_t localIte0 = 0;542 uint8_t localIte1 = 0;543 uint8_t localIte2 = 0;544 uint8_t localIte3 = 0;545 uint8_t localIte4 = 0;546 uint8_t localNum = 0;547 uint8_t localTemp = 0;548549while (1)550 {551if (localNum == 0)552 {553 FunAppOledShowChinese(128, 24, localTemp, 16);//写⼊⼀个汉字保存在OLED_GRAM中554 localTemp++;555 }556557if (localTemp == Num)558 {559for (localIte0 = 0; localIte0 < (16 * Space); localIte0++)//显⽰间隔560 {561for (localIte1 = 0; localIte1 < 144; localIte1++)562 {563for (localIte2 = 0; localIte2 < 8; localIte2++)564 {565 OLED_GRAM[localIte1 - 1][localIte2] = OLED_GRAM[localIte1][localIte2]; 566 }567 }568 FunAppOledRefresh();569 }570 localTemp = 0;571 }572 localNum++;573if (localNum == 16)574 {575 localNum = 0;576 }577for (localIte3 = 0; localIte3 < 144; localIte3++) //左移578 {579for (localIte4 = 0; localIte4 < 8; localIte4++)580 {581 OLED_GRAM[localIte3 - 1][localIte4] = OLED_GRAM[localIte3][localIte4];582 }583 }584 FunAppOledRefresh();585 }586 }587588/*************************************************589函数名称 : FunAppOledWriteBP590功能描述 : 配置写⼊数据的起始位置591被调⽤清单 : ⽆592调⽤清单 :593输⼊参数 : (X , Y)起始位置坐标594输出参数 : ⽆595返回参数 : ⽆596其他 : ⽆597*************************************************/598void FunAppOledWriteBP(uint8_t X, uint8_t Y)599 {600 FunAppOledWriteByte((0xB0 + Y), OLED_CMD);601 FunAppOledWriteByte(((X & 0xF0) >> 4) | 0x10, OLED_CMD);602 FunAppOledWriteByte((X & 0x0F) | 0x01, OLED_CMD);603 }604605/*************************************************606函数名称 : FunAppOledShowPicture607功能描述 : 显⽰图⽚608被调⽤清单 : ⽆609调⽤清单 :610输⼊参数 : (X1 , Y1)起始坐标 (X2 , Y2)终点坐标 Bmp要写⼊的图⽚数组611输出参数 : ⽆612返回参数 : ⽆613其他 : ⽆614*************************************************/615void FunAppOledShowPicture(uint8_t X1, uint8_t Y1, uint8_t X2, uint8_t Y2, uint8_t *Bmp) 616 {617 uint32_t localIte0 = 0;618 uint8_t localX = 0;619 uint8_t localY = 0;620621if ((localY % 8) == 0)622 {623 localY = 0;624 }625else626 {627 localY += 1;628 }629630for (localY = Y1; localY < Y2; localY++)631 {632 FunAppOledWriteBP(X1, localY);633for (localX = X1; localX < X2; localX++)634 {635 FunAppOledWriteByte(Bmp[localIte0], OLED_DATA);636 localIte0++;637 }638 }639 }640641/*************************************************642函数名称 : FunAppOledColorTurn643功能描述 : 反显函数644被调⽤清单 : ⽆645调⽤清单 :646输⼊参数 : Mode == 0正常显⽰, Mode == 1反⾊显⽰647输出参数 : ⽆648返回参数 : ⽆649其他 : ⽆650*************************************************/651void FunAppOledColorTurn(uint8_t Mode)652 {653if (Mode == 0)654 {655 FunAppOledWriteByte(0xA6, OLED_CMD);//正常显⽰656 }657658if (Mode == 1)659 {660 FunAppOledWriteByte(0xA7, OLED_CMD);//反⾊显⽰661 }662 }663664/*************************************************665函数名称 : FunAppOledDisplayTurn666功能描述 : 屏幕旋转180°667被调⽤清单 : ⽆668调⽤清单 :669输⼊参数 : Mode == 0正常显⽰ Mode == 1反转显⽰670输出参数 : ⽆671返回参数 : ⽆672其他 : ⽆673*************************************************/674void FunAppOledDisplayTurn(uint8_t Mode)675 {676if (Mode == 0)677 {678 FunAppOledWriteByte(0xC8, OLED_CMD);//正常显⽰679 FunAppOledWriteByte(0xA1, OLED_CMD);680 }681682if (Mode == 1)683 {684 FunAppOledWriteByte(0xC0, OLED_CMD);//反转显⽰685 FunAppOledWriteByte(0xA0, OLED_CMD);686 }687 }4、字体OLED_FONT.h1/************************************************************2 * Copyright (C) 2021 , 伽椰⼦真可爱3 * All right reserved.4 * ⽂件名称:OLED_FONT.h5 * 作者:⾼弟(GaoDi)6 * 原始版本:V1.07 * 创建⽇期:2022/1/108 * ⽂件描述:OLED字体9 * 函数列表:10 *11 * 历史:12 * <作者> <时间> <版本> <功能描述>13 *14 * **********************************************************/15 #ifndef _OLED_FONT_H_16#define _OLED_FONT_H_1718//常⽤ASCII表19//偏移量3220//ASCII字符集21//偏移量3222//⼤⼩:12*623/************************************6*8的点阵************************************/24//12*12 ASCII字符集点阵25const unsigned char asc2_1206[95][12]={26 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*" ",0*/27 {0x00,0x00,0x00,0x00,0x3F,0x40,0x00,0x00,0x00,0x00,0x00,0x00},/*"!",1*/28 {0x00,0x00,0x30,0x00,0x40,0x00,0x30,0x00,0x40,0x00,0x00,0x00},/*""",2*/29 {0x09,0x00,0x0B,0xC0,0x3D,0x00,0x0B,0xC0,0x3D,0x00,0x09,0x00},/*"#",3*/30 {0x18,0xC0,0x24,0x40,0x7F,0xE0,0x22,0x40,0x31,0x80,0x00,0x00},/*"$",4*/31 {0x18,0x00,0x24,0xC0,0x1B,0x00,0x0D,0x80,0x32,0x40,0x01,0x80},/*"%",5*/32 {0x03,0x80,0x1C,0x40,0x27,0x40,0x1C,0x80,0x07,0x40,0x00,0x40},/*"&",6*/33 {0x10,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"'",7*/。
0.96寸oled显示屏白色12864分辨率设计手册结构尺寸开发原理图新手必读测试代码指南结构图
OLED屏幕显示的优点:1、厚度可以做到0.01毫米,并且重量也更轻,可以做成柔性,应用前景非常好;2、固态发光物资,没有液体物质,因此抗震性能好;3、可视角度接近180°,即使在很大的视角下观看,画面仍然不失真,亮度不减;4、响应时间是微秒级,LCD是毫秒级,显示运动画面绝对不会有拖影的现象,特别是看足球比赛,没有延迟感;5、低温特性非常好,在零下40度时仍能正常显示,军工产品特别青睐;6、二片玻璃加上发光有机物,制造工艺简单,成本更低,目前暂时处在初期,开发成本较高,良率不高;7、发光效率更高,能耗更低,被白色背景下除外,这也是电脑显示屏不能普及OLED显示屏的问题所在;8、可以做成透明的,应用在头盔、导航等领域;9、可以做成照明产品,发光效率高,接近日光,目前难点在寿命,目前有开发应用在汽车尾灯上面,估计很快有相关概念车上市10、色彩艳丽,还原真实。
OLED显示屏被认为是下一代平面显示器的佼佼者,而它全面覆盖我们日常生活的时代也即将到来。
OLED显示屏可以自发光,反应灵敏,制作简单,操作方便,一旦技术成熟且量产后,它可以广泛应用到航空、汽车、家电、手机等各类电子科技产品。
0.96寸128x64分辨率OLED液晶点阵并口显示屏高清小尺寸模块模组,三种颜色:0.96寸白光、0.96寸蓝光、0.96寸黄蓝双色。
它们一般都有哪些特点和优点呢?对于消费者来说,想购买0.96英寸128x64分辨率oled液晶显示屏要看厂家,生产厂家哪家好才重要。
常用型号和编号:VG-2864KSWEG01/SSD1306/白光焊接、VG-2864KLBEG01/SSD1306/蓝光焊接、VG-2864KMBEG01/SSD1306/双色焊接、0.96英寸oled模块4针TW128640960A(含白色、蓝色、黄蓝双色三种颜色),0.96英寸oled模块6针TW128640960D模块(含白色、蓝色、黄蓝双色三种颜色)、0.96英寸oled模块7针模块TW128640960AB(含白色、蓝色、黄蓝双色三种颜色),0.96寸白光OLED、0.96寸蓝光OLED、0.96寸黄蓝双色OLED、全部带内置DC/DC.应用:智能水杯、蓝牙产品、智能手表、运动手环、电子烟、医疗血氧仪、智能门锁、保险柜、检测仪等消费产品。
中景园电子0.96OLED显示屏_模块说明书
中景园电子0.96OLED显示屏_模块说明书
一、OLED技术特点
(1)OLED 器件的核心层厚度很薄,厚度可以小于1mm,为液晶的1/3。
(2)OLED 器件为全固态机构,无真空,液体物质,抗震性好,可以适应巨大的加速度,振动等恶劣环境。
(3)主动发光的特性使OLED 几乎没有视角限制,视角一般可达到170 度,具有较宽的视角,从侧面也不会失真。
(4)OLED 显示屏的响应时间超过TFT—LCD 液晶屏。
TFT—LCD 的响应时间大约是几十毫秒,现在做得最好的TFT—LCD 响应时间也只有12 毫秒。
而OLED 显示屏的响应时间大约是几微秒到几十微秒。
(5)OLED 低温特性好,在零下40 摄氏度都能正常显示,目前航天服上也使用OLED 作为显示屏。
而TFT—LCD 的响应速度随温度发生变化,低温下,其响应速度变慢,因此,液晶在低温下显示效果不好。
(6)OLED 采用有机发光原理,所需材料很少,制作上比采用液体发光的液晶工序少,液晶显示屏少 3 道工序,成本大幅降低。
(7)OLED 采用的二极管会自行发光,因此不需要背面光源,发光转化效率高,能耗比液晶低,OLED 能够在不同材质的基板上制造,厂家甚至可以将电路印刷在弹性材料上——做成能弯曲的柔软显示器。
(8)低电压直流驱动,5V 以下,用电池就能点亮。
高亮度,可达300 明流以上。
0.96寸oled显示屏使用手册
0.96寸OLED显示屏使用手册前言随着科技的不断发展,OLED显示屏作为一种新型的显示技术已经逐渐成为各种电子产品的标配。
其色彩饱和度高、对比度优秀、响应速度快等特点,使得它在智能穿戴设备、便携设备、医疗设备等领域得到了广泛的应用。
本手册将介绍0.96寸OLED显示屏的使用方法及注意事项,帮助用户更好地了解和操作该显示屏。
一、产品概述0.96寸OLED显示屏是一种小尺寸的OLED显示屏,通常用于智能手环、智能手表、可穿戴设备、小型医疗设备等产品中。
它采用了OLED(有机发光二极管)技术,具有超薄、低功耗、高对比度等特点,能够在低电压下实现高亮度显示。
该显示屏具有128x64像素的分辨率,支持SPI和I2C两种通信方式,便于与各种微控制器或单片机进行连接。
二、使用准备在使用0.96寸OLED显示屏之前,首先需要准备以下设备和材料:1. 0.96寸OLED显示屏模块2. 微控制器或单片机(例如Arduino、Raspberry Pi等)3. 杜邦线或排针4. 电源供应器(如果需要外部供电)三、连接方法0.96寸OLED显示屏通常通过SPI或I2C接口与微控制器或单片机连接。
以下是连接方法的具体步骤:1. 将0.96寸OLED显示屏模块的VCC引脚接到电源正极,将GND引脚接到电源负极,确保接线正确并稳固。
2. 根据所采用的通信方式,将SCL和SDA引脚(对于I2C通信方式)或DC和RES引脚(对于SPI通信方式)连接到微控制器或单片机相应的引脚上。
3. 如需外部供电,连接合适的电源供应器并接通电源。
四、调试与显示连接完成后,可以通过编写程序来控制0.96寸OLED显示屏的显示内容。
以下是一个简单的Arduino示例代码:```#include <Wire.h>#include <Adafruit_GFX.h>#include <Adafruit_SSD1306.h>#define OLED_RESET -1Adafruit_SSD1306 display(128, 64, &Wire, OLED_RESET);void setup() {display.begin(SSD1306_SWITCHCAPVCC, 0x3C);display.display();delay(2000);display.clearDisplay();}void loop() {display.setTextSize(1);display.setTextColor(SSD1306_WHITE);display.setCursor(0,0);display.println("Hello, World!");display.display();delay(1000);display.clearDisplay();}```通过以上示例代码,您可以实现在0.96寸OLED显示屏上显示“Hello, World!”的效果。
0.96寸OLED点亮原理,通过对驱动芯片的设置,实现OLED的点亮,C语言例程,在OLED上显示汉字
图 2.3.1 中端口 COM 和端口 SEG 与 GDDRAM 的对应关系是可以软件设置的。 在软件设置的时候用到这个函数:OLED_WCMD(u8 cmd);//向 SSD1306 写命令。这里 不详细介绍,在程序设计中详细介绍。 当写入一个字节到 GDDRAM 时,这字节又是怎么存储的呢,请看 2.3.2: 每一个 Bit 存储在一个方格中,再看红色圈出部位,每个方格代表着每个像素点,这样, GDDRAM 和像素点之间就构成了联系。
IIC 接口模式:接 GND
7
SO
GT20L16S1Y 的串行数据输出端口
8
CS2
GT20L16S1Y 的片选端口
第 1页 共 26 页
0.96’OLED
2 OLED 点亮原理
0.96’OLED 模块(以下简称 OLED)显示屏由两个部分构成,有效的显示部分和驱动 芯片 SSD1306,此芯片被固化在液晶显示玻璃的背部。额外设计字库模块,方便显示不同 字体的字符பைடு நூலகம்汉字。
0.96’OLED
图 2.1.4 设置图片像素
0.96’OLED 的显示大小为 128×64 的,我们设置图片像素为 60×64,然后将图片另存 为 BMP 格式。
图 2.1.5 另存为 BMP 格式
打开取模软件,点击圆圈处图标,导入图片,取模方式和上面相同,导入图片后,点击 “生成字模”,生成一个多维数组,将部分大括号“{}”删除,变为一维数组,得到图片
1
0.96’OLED
1 0.96’OLED 简介
OLED(Organic Light-Emitting Diode):有机发光二极管又称为有机电激光显示,由美籍 华裔教授邓青云在实验室中发现,由此展开了对 OLED 的研究。OLED 显示技术具有自发 光的特性,采用非常薄的有机材料涂层和玻璃基板,当有电流通过时,这些有机材料就会发
0.96寸OLED模块-简述如何修改OLED_ShowChar()函数达到修改显示字体大小的目的
0.96⼨OLED模块-简述如何修改OLED_ShowChar()函数达到修改显⽰字体⼤⼩的⽬的⾸先上OLED_ShowChar()函数//在指定位置显⽰⼀个字符,包括部分字符//x:0~127//y:0~63//mode:0,反⽩显⽰;1,正常显⽰//size:选择字体 48/24/32/16/12void OLED_ShowChar(u8 x, u8 y, u8 chr, u8 Char_Size){unsigned char c = 0, i = 0;c = chr - ''; //得到偏移后的值if (x > Max_Column - 1) {x = 0; y = y + 2;}if (Char_Size == 48){OLED_Set_Pos(x, y);for (i = 0; i < 24; i++)OLED_WR_Byte(F24X48[c * 144 + i], OLED_DATA);OLED_Set_Pos(x, y + 1);for (i = 0; i < 24; i++)OLED_WR_Byte(F24X48[c * 144 + i +24], OLED_DATA);OLED_Set_Pos(x, y + 2);for (i = 0; i < 24; i++)OLED_WR_Byte(F24X48[c * 144 + i +48], OLED_DATA);OLED_Set_Pos(x, y + 3);for (i = 0; i < 24; i++)OLED_WR_Byte(F24X48[c * 144 + i +72], OLED_DATA);OLED_Set_Pos(x, y + 4);for (i = 0; i < 24; i++)OLED_WR_Byte(F24X48[c * 144 + i +96], OLED_DATA);OLED_Set_Pos(x, y + 5);for (i = 0; i < 24; i++)OLED_WR_Byte(F24X48[c * 144 + i +120], OLED_DATA);}else if(Char_Size == 32){OLED_Set_Pos(x, y);for (i = 0; i < 16; i++)OLED_WR_Byte(F16X32[c * 64 + i], OLED_DATA);OLED_Set_Pos(x, y+1);for (i = 0; i < 16; i++)OLED_WR_Byte(F16X32[c * 64+ i+16], OLED_DATA);OLED_Set_Pos(x, y+2);for (i = 0; i < 16; i++)OLED_WR_Byte(F16X32[c * 64 + i+32], OLED_DATA);OLED_Set_Pos(x, y+3);for (i = 0; i < 16; i++)OLED_WR_Byte(F16X32[c * 64 + i+48], OLED_DATA);}//F12X24字库:⼀⾏36个,else if (Char_Size == 24){OLED_Set_Pos(x, y);for (i = 0; i < 12; i++)OLED_WR_Byte(F12X24[c * 36 + i], OLED_DATA); //18*2OLED_Set_Pos(x, y + 1);for (i = 0; i < 12; i++)OLED_WR_Byte(F12X24[c * 36 + i +12], OLED_DATA);OLED_Set_Pos(x, y + 2);for (i = 0; i < 12; i++)OLED_WR_Byte(F12X24[c * 36 + i +24], OLED_DATA);}else if (Char_Size == 16){OLED_Set_Pos(x, y);for (i = 0; i < 8; i++)OLED_WR_Byte(F8X16[c * 16 + i], OLED_DATA);OLED_Set_Pos(x, y + 1);for (i = 0; i < 8; i++)OLED_WR_Byte(F8X16[c * 16 + i + 8], OLED_DATA);}else{OLED_Set_Pos(x, y);for (i = 0; i < 6; i++)OLED_WR_Byte(F6x8[c][i], OLED_DATA);}}这个函数原来没有Char_Size == 32这个分⽀,我在使⽤过程中需要显⽰适中的⼤⼩,所以研究了下,完成了16*32字体。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
一、OLED技术特点
(1) OLED 器件的核心层厚度很薄,厚度可以小于 1mm,为液晶的 1/3。
(2) OLED 器件为全固态机构,无真空,液体物质,抗震性好,可以适应巨大
的加速度,振动等恶劣环境。
(3)主动发光的特性使 OLED 几乎没有视角限制,视角一般可达到 170 度,具有较宽的视角,从侧面也不会失真。
(4) OLED 显示屏的响应时间超过 TFT—LCD 液晶屏。
TFT—LCD 的响应时间大约使几十毫秒,现在做得最好的 TFT—LCD 响应时间也只有 12 毫秒。
而 OLED 显示屏的响应时间大约是几微秒到几十微秒。
(5) OLED 低温特性好,在零下 40 摄氏度都能正常显示,目前航天服上也使用OLED 作为显示屏。
而 TFT—LCD 的响应速度随温度发生变化,低温下,其响应速度变慢,因此,液晶在低温下显示效果不好。
(6) OLED 采用有机发光原理,所需材料很少,制作上比采用液体发光的液晶
工序少,液晶显示屏少 3 道工序,成本大幅降低。
(7) OLED 采用的二极管会自行发光,因此不需要背面光源,发光转化效率高,能耗比液晶低,OLED 能够在不同材质的基板上制造,厂家甚至可以将电路印刷
在弹性材料上——做成能弯曲的柔软显示器。
(8)低电压直流驱动,5V 以下,用电池就能点亮。
高亮度,可达 300 明流以上。
Welcome To Download !!!
欢迎您的下载,资料仅供参考!。