主要是对显示汉字的程序做了优化
单片机源程序如下:
- #include "sys.h"
- #include "delay.h"
- #include "usart.h"
- #include "led.h"
- #include "oled.h"
- int main(void)
- {
- NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);//设置系统中断优先级分组2
- delay_init(168); //初始化延时函数
- uart_init(115200); //初始化串口波特率为115200
- LED_Init(); //初始化LED
- OLED_Init(); //初始化OLED
-
- OLED_ShowCHinese(0,0,0,1);
- OLED_ShowCHinese(18,0,1,1);
- OLED_ShowCHinese(36,0,2,1);
- OLED_ShowCHinese(54,0,3,1);
- OLED_ShowCHinese(72,0,4,1);
- OLED_ShowCHinese(90,0,5,1);
- OLED_ShowCHinese(108,0,6,1);
-
-
- OLED_ShowCHinese(16,16,7,1);
- OLED_ShowCHinese(32,16,8,1);
- OLED_ShowCHinese(48,16,9,1);
- OLED_ShowCHinese(64,16,10,1);
- OLED_ShowCHinese(80,16,11,1);
- OLED_ShowCHinese(96,16,12,1);
-
- OLED_ShowCHinese(0,32,13,1);
- OLED_ShowCHinese(16,32,14,1);
- OLED_ShowString(32,32,":2018-6-16",12);
-
- OLED_ShowCHinese(80,48,15,1);
- OLED_ShowCHinese(96,48,16,1);
- OLED_ShowCHinese(112,48,17,1);
-
- OLED_Refresh_Gram();//更新显示到OLED
-
- while(1)
- {
- }
- }
复制代码
所有资料51hei提供下载:
超好用的OLED程序(SPI F4 中景园).rar
(471.45 KB, 下载次数: 180)
|