标题: 0.96 OLED STM32驱动代码 [打印本页]

作者: beast777    时间: 2021-5-9 09:49
标题: 0.96 OLED STM32驱动代码
以前做的OLED显示。
支持英文,数字,字符,但不支持中文

供大家参考一下吧

单片机源程序如下:
  1. #include "stm32f10x.h"  
  2. #include "bsp_i2c_gpio.h"
  3. #include "bsp_usart.h"
  4. #include "SSD1306.h"

  5. extern OLED_IN OLED_In;
  6. static void BSP_Init(void);

  7. int main(void)
  8. {       
  9.        
  10.         uint16_t i;

  11.   BSP_Init();
  12.         OLED_Refresh();
  13.         OLED_In.buff_in[0] ="a0";
  14.         OLED_In.buff_in[1] ="b1";
  15.         OLED_In.buff_in[2] ="c2";
  16.         OLED_In.buff_in[3] ="d3";
  17.         OLED_In.buff_in[4] ="e4";
  18.         OLED_In.buff_in[5] ="f5";       
  19.         OLED_In.buff_in[6] ="a6";
  20.         OLED_In.buff_in[7] ="b7";
  21.         OLED_In.buff_in[8] ="c8";
  22.         OLED_In.buff_in[9] ="d9";
  23.         OLED_In.buff_in[10] ="10";
  24.         OLED_In.buff_in[11] ="11";       
  25.        
  26.         OLED_Refresh();
  27. //        OLED_ShowString(0,0,"hhhhhh",16);
  28.         while(1){
  29.   OLED_ShowON(12);
  30.     }

  31. }

  32. static void BSP_Init(void)
  33. {
  34.         Key_GPIO_Config();
  35.         USART_Config();
  36.   OLED_Config();
  37. }
复制代码

所有资料51hei提供下载:
OLED_last.7z (446.21 KB, 下载次数: 17)






欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1