|
#include "stm32f10x.h"
#include "OLED_I2C.h"
#include "delay.h"
int main(void)
{
unsigned char i;
extern const unsigned char BMP1[];
extern const unsigned char BMP2[];
DelayInit();
I2C_Configuration();
OLED_Init();
while(1)
{
OLED_Fill(0xFF);//全屏点亮
DelayS(1);
OLED_Fill(0x00);//全屏灭
DelayS(1);
for(i=0;i<5;i++)
{
OLED_ShowCN(22+i*16,0,i);//测试显示中文
}
DelayS(1);
OLED_ShowStr(0,4,"Youth time is fleet.",1);//测试6*8字符
OLED_ShowStr(80,6,"Horace",2); //测试8*16字符
DelayS(2);
OLED_CLS();//清屏
OLED_OFF();//测试OLED休眠
DelayS(2);
OLED_ON();//测试OLED休眠后唤醒
OLED_DrawBMP(0,0,128,8,(unsigned char *)BMP2);//测试BMP位图显示
DelayS(2);
while(1)
{
for(i=0;i<5;i++)
{
OLED_ShowCN(22+i*16,0,i);//测试显示中文
}
}
}
}
|
|