oled驱动程序
- #include "delay.h"
- #include "sys.h"
- #include "oled.h"
- #include "bmp.h"
- int main(void)
- {
- u8 t;
- delay_init();
- OLED_Init();
- OLED_Clear();
- t=' ';//空格
- while(1)
- {
- OLED_Clear();
- OLED_ShowChinese(0,0,0);
- OLED_ShowChinese(18,0,1);
- OLED_ShowChinese(36,0,2);
- OLED_ShowChinese(54,0,3);
- OLED_ShowChinese(72,0,4);
- OLED_ShowChinese(90,0,5);
- OLED_ShowChinese(108,0,6);
- OLED_ShowString(0,3," 'OLED TEST' ");
-
- OLED_ShowString(0,6," ASCII: ");
- OLED_ShowString(0,3,"CODE: ");
- OLED_ShowChar(48,6,t);
- t++;
- if(t>'~') t=' ';
- OLED_ShowNum(103,6,t,3,16);
-
- OLED_Clear();
- OLED_DrawBMP(0,0,128,8,BMP1);
- delay_ms(1000);
- OLED_DrawBMP(0,0,128,8,BMP2);
- delay_ms(1000);
- }
- return 0;
- }
复制代码
代码下载:
0.96inch_OLED_Demo_STM32F103RCT6_Hardware_4-wire_SPI.7z
(196.22 KB, 下载次数: 22)
|