极客工坊

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1870|回复: 12

真正可用的OLED驱动程序!!!

  [复制链接]
发表于 2017-8-19 23:09:06 | 显示全部楼层 |阅读模式
          趁着电赛买了块IOLED屏,I2C通讯,可以用STM32的程序驱动,但我想用arduino驱动时找了好几个库文件都没有点亮驱动起来,一气之下就把32的程序给改装过来了,并且把它封装成库文件,只需要几行代码就能轻松点亮你想要的显示。移植过来的程序满足日常显示,比如显示字符串,中文,数字量。。。图片等。
        ino为分别三个文件(为了区分而把文字和图片的数据给分开放)
        直接下载附件即可!
  1. /*********************************ino1******************************************************************/
  2. /*创建     时间 地点:大二暑假;桂电信科小间实验室
  3. * 来             源:从STM32移植过来
  4. * 我只是个   搬运工:刘
  5. * 程序         现状:完美显示!
  6. * 取模         软件:可用Pctolcd2002完美版取模(图片模式)用电脑画板选择 黑白 128 X 64其实对应0—127
  7. *                    阴码 逆向 列行式
  8. *                    存储图片数据,图片大小为64*32像素
  9. *                     
  10. */
  11. #include <OLED.h>
  12. //引脚设置SCL SDA
  13. OLED oled(5,6);
  14. extern unsigned char BMP1[];
  15. extern unsigned char BMP2[];
  16. void setup() {
  17.    oled.OLED_Init();  //初始化OLED  
  18.    oled.OLED_Clear(); //清屏

  19. }

  20. void loop() {
  21.     oled.OLED_Clear();//清屏
  22.     oled.OLED_ShowCHinese(0,0,0); //桂
  23.     oled.OLED_ShowCHinese(18,0,1);//电
  24.     oled.OLED_ShowCHinese(36,0,2);//信
  25.     oled.OLED_ShowCHinese(54,0,3);//科
  26.     oled.OLED_ShowCHinese(72,0,4);//韦
  27.     oled.OLED_ShowCHinese(90,0,5);//卫
  28.     oled.OLED_ShowCHinese(108,0,6);//军
  29.                    //X Y坐标    字符串  大小(12/16)
  30.     oled.OLED_ShowString(6,4,"1.23' OLED WWJ",16);//显示一个字符号串:0.96' OLED WWJ
  31.     delay(2000);
  32.     oled.OLED_DrawBMP(0,0,128,8,BMP1);//图片显示(图片显示慎用,生成的字表较大,会占用较多空间,FLASH空间8K以下慎用)
  33.     delay(2000);
  34.     oled.OLED_DrawBMP(0,0,128,8,BMP2);//图片显示(图片显示慎用,生成的字表较大,会占用较多空间,FLASH空间8K以下慎用)
  35.     delay(2000);
  36. }
  37. /*************************************************ino2*********************************************************/

  38. //可用Pctolcd2002完美版取模(图片模式)用电脑画板选择 黑白 128 X 64其实对应0—127
  39. //阴码 逆向 列行式
  40. //存储图片数据,图片大小为64*32像素

  41. unsigned char BMP1[] =
  42. {
  43.   //个性签名:韦卫军  
  44.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  45.   0x00,0x00,0x00,0x00,0xC0,0x70,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  46.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  47.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  48.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  49.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  50.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  51.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  52.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  53.   0x30,0x10,0xF8,0x0E,0x09,0x04,0x05,0xFE,0x86,0xE2,0x9E,0x00,0x00,0x00,0x00,0x00,
  54.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x40,0x60,0x20,0x20,0x10,0x18,
  55.   0x18,0x08,0x04,0x06,0x02,0x02,0x02,0x01,0x01,0x01,0x01,0x03,0x02,0x0C,0xF0,0x00,
  56.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x70,0xF8,0x60,0x20,
  57.   0x20,0x20,0x10,0x10,0x10,0x10,0x10,0x18,0x18,0x08,0x08,0x08,0x00,0x08,0x04,0x86,
  58.   0x82,0x82,0x02,0x02,0x02,0x02,0x82,0x62,0x12,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,
  59.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  60.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  61.   0x00,0x80,0xFF,0xC2,0x41,0xA1,0xFF,0x88,0x44,0x42,0x41,0x40,0x40,0x40,0x40,0xC0,
  62.   0x40,0x70,0x58,0x48,0x44,0x44,0x44,0x42,0x41,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
  63.   0xDF,0x11,0x21,0x22,0x24,0x38,0xE0,0x20,0x20,0x20,0x10,0x18,0x10,0x07,0x01,0x00,
  64.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x80,0x80,
  65.   0x80,0x80,0xC0,0xC0,0xC0,0xA0,0xE0,0xA0,0xA0,0xA0,0x90,0x90,0xD0,0x7F,0x4D,0x2C,
  66.   0x14,0x17,0x1F,0x02,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  67.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  68.   0x20,0x20,0x30,0x38,0x10,0x18,0x14,0x0C,0x1C,0x0A,0x06,0x06,0x06,0x02,0x01,0x03,
  69.   0x01,0x01,0xFF,0x00,0xF5,0x0F,0x01,0x80,0x40,0x20,0x10,0x0C,0x03,0x01,0x01,0x00,
  70.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x40,0x40,0x70,0x18,0x04,0x02,
  71.   0x01,0x00,0x00,0x00,0xC0,0x38,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  72.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x01,0x01,
  73.   0x01,0x01,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x1F,0x00,0x00,0x00,
  74.   0x00,0x00,0x00,0x80,0x00,0x80,0x80,0x80,0x80,0x80,0x40,0x40,0x40,0x40,0x40,0x40,
  75.   0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  76.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  77.   0x00,0x00,0x1F,0x1E,0x31,0x24,0x27,0x21,0x20,0x20,0x20,0x20,0x10,0x10,0x10,0x10,
  78.   0x10,0x08,0x04,0x04,0x04,0x02,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  79.   0x00,0x00,0x0E,0x0A,0x09,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,
  80.   0x08,0x08,0x08,0x08,0x08,0x08,0x04,0x04,0x04,0x02,0x01,0x01,0x01,0x00,0x00,0x00,
  81.   0x00,0x00,0x00,0x00,0x00,0x70,0xD8,0x04,0x04,0x02,0x02,0x03,0x7F,0x83,0x01,0x01,
  82.   0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  83.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  84.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  85.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  86.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  87.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  88.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  89.   0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x02,0x04,0x08,0x18,0x10,0x10,0x23,0x3C,0x30,
  90.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  91.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  92.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x18,0x28,0xC8,0x08,0x08,0x08,
  93.   0x08,0x04,0x04,0x02,0x01,0x02,0x04,0x04,0x08,0x08,0x08,0x08,0xC8,0x28,0x18,0x08,
  94.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  95.   0x00,0x08,0x18,0x28,0xC8,0xC8,0x08,0x08,0x08,0x08,0x0C,0x04,0x03,0x01,0x01,0x02,
  96.   0x04,0x08,0x08,0x08,0x08,0x08,0x48,0xC8,0x38,0x18,0x08,0x00,0x00,0x00,0x00,0x00,
  97.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x08,0x98,0x78,0x08,0x08,0x08,0x0C,0x04,
  98.   0x04,0x02,0x01,0x01,0x03,0x04,0x04,0x08,0x08,0x08,0x08,0x68,0x98,0x88,0x08,0x00,
  99.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  100.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x07,0x05,0x05,0x04,0x04,0x04,
  101.   0x04,0x08,0x08,0x10,0x30,0x10,0x08,0x08,0x04,0x04,0x04,0x04,0x05,0x05,0x07,0x04,
  102.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  103.   0x00,0x04,0x07,0x05,0x05,0x04,0x04,0x04,0x04,0x04,0x04,0x08,0x10,0x20,0x20,0x10,
  104.   0x18,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x05,0x06,0x04,0x00,0x00,0x00,0x00,0x00,
  105.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,
  106.   0x02,0x04,0x0C,0x08,0x04,0x02,0x03,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,
  107.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  108. };
  109. unsigned char BMP2[] =
  110. {
  111.   0x00,0x06,0x0A,0xFE,0x0A,0xC6,0x00,0xE0,0x00,0xF0,0x00,0xF8,0x00,0x00,0x00,0x00,
  112.   0x00,0x00,0xFE,0x7D,0xBB,0xC7,0xEF,0xEF,0xEF,0xEF,0xEF,0xEF,0xEF,0xC7,0xBB,0x7D,
  113.   0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  114.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  115.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  116.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,
  117.   0x0C,0xFE,0xFE,0x0C,0x08,0x20,0x60,0xFE,0xFE,0x60,0x20,0x00,0x00,0x00,0x78,0x48,
  118.   0xFE,0x82,0xBA,0xBA,0x82,0xBA,0xBA,0x82,0xBA,0xBA,0x82,0xBA,0xBA,0x82,0xFE,0x00,
  119.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  120.   0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
  121.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  122.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  123.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  124.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  125.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  126.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  127.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  128.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFF,
  129.   0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0xFF,0xFF,0x00,0x00,0xFE,0xFF,0x03,
  130.   0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0xFF,0xFE,0x00,0x00,0x00,0x00,0xC0,0xC0,
  131.   0xC0,0x00,0x00,0x00,0x00,0xFE,0xFF,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
  132.   0xFF,0xFE,0x00,0x00,0xFE,0xFF,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0xFF,
  133.   0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  134.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  135.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  136.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,
  137.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0xFF,0xFF,0x0C,
  138.   0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0xFF,0xFF,0x00,0x00,0x00,0x00,0xE1,0xE1,
  139.   0xE1,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  140.   0xFF,0xFF,0x00,0x00,0xFF,0xFF,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0xFF,
  141.   0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  142.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  143.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  144.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x1F,
  145.   0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x0F,0x00,0x00,0x0F,0x1F,0x18,
  146.   0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,
  147.   0x00,0x00,0x00,0x00,0x00,0x0F,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
  148.   0x1F,0x0F,0x00,0x00,0x0F,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,
  149.   0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  150.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  151.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  152.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  153.   0x00,0x00,0x8C,0x42,0x22,0x12,0x0C,0x00,0xFC,0x02,0x02,0x02,0xFC,0x00,0x00,0x04,
  154.   0xFE,0x00,0x00,0x00,0x20,0x58,0x44,0xFE,0x40,0x00,0x10,0x10,0x10,0x10,0x10,0x00,
  155.   0x00,0x04,0xFE,0x00,0x00,0x00,0xFC,0x02,0x02,0x02,0xFC,0x00,0x10,0x10,0x10,0x10,
  156.   0x10,0x00,0xFC,0x02,0x02,0x02,0xFC,0x00,0x00,0x04,0xFE,0x00,0x00,0x00,0x00,0x00,
  157.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  158.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  159.   0x00,0x24,0xA4,0x2E,0x24,0xE4,0x24,0x2E,0xA4,0x24,0x00,0x00,0x00,0xF8,0x4A,0x4C,
  160.   0x48,0xF8,0x48,0x4C,0x4A,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  161.   0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x01,0x01,0x01,0x00,0x00,0x00,0x01,
  162.   0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  163.   0x00,0x01,0x01,0x01,0x00,0x00,0x00,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
  164.   0x00,0x00,0x00,0x01,0x01,0x01,0x00,0x00,0x00,0x01,0x01,0x01,0x00,0x00,0x00,0x00,
  165.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x20,0x10,0x10,
  166.   0x10,0x10,0x20,0xC0,0x00,0x00,0xC0,0x20,0x10,0x10,0x10,0x10,0x20,0xC0,0x00,0x00,
  167.   0x00,0x12,0x0A,0x07,0x02,0x7F,0x02,0x07,0x0A,0x12,0x00,0x00,0x00,0x0B,0x0A,0x0A,
  168.   0x0A,0x7F,0x0A,0x0A,0x0A,0x0B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  169.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  170.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  171.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  172.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  173.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x20,0x40,0x40,
  174.   0x40,0x50,0x20,0x5F,0x80,0x00,0x1F,0x20,0x40,0x40,0x40,0x50,0x20,0x5F,0x80,0x00

  175. };
  176. /************************************ino3*********************************************/
  177. char Hzk[][32] = {

  178.   { 0x10,0x10,0xD0,0xFF,0x90,0x10,0x40,0x44,0x44,0x44,0x7F,0x44,0x44,0x44,0x40,0x00 },
  179.   { 0x04,0x03,0x00,0xFF,0x00,0x03,0x40,0x44,0x44,0x44,0x7F,0x44,0x44,0x44,0x40,0x00 },/*"桂",0*/

  180.   { 0x00,0x00,0xF8,0x88,0x88,0x88,0x88,0xFF,0x88,0x88,0x88,0x88,0xF8,0x00,0x00,0x00 },
  181.   { 0x00,0x00,0x1F,0x08,0x08,0x08,0x08,0x7F,0x88,0x88,0x88,0x88,0x9F,0x80,0xF0,0x00 },/*"电",1*/

  182.   { 0x00,0x80,0x60,0xF8,0x07,0x00,0x04,0x24,0x24,0x25,0x26,0x24,0x24,0x24,0x04,0x00 },
  183.   { 0x01,0x00,0x00,0xFF,0x00,0x00,0x00,0xF9,0x49,0x49,0x49,0x49,0x49,0xF9,0x00,0x00 },/*"信",2*/

  184.   { 0x24,0x24,0xA4,0xFE,0xA3,0x22,0x00,0x22,0xCC,0x00,0x00,0xFF,0x00,0x00,0x00,0x00 },
  185.   { 0x08,0x06,0x01,0xFF,0x00,0x01,0x04,0x04,0x04,0x04,0x04,0xFF,0x02,0x02,0x02,0x00 },/*"科",3*/

  186.   { 0x00,0x08,0x48,0x48,0x48,0x48,0x48,0xFF,0x48,0x48,0x48,0x48,0x48,0x08,0x08,0x00 },
  187.   { 0x00,0x02,0x02,0x02,0x02,0x02,0x02,0xFF,0x02,0x02,0x22,0x42,0x22,0x1E,0x00,0x00 },/*"韦",4*/

  188.   { 0x00,0x02,0x02,0x02,0x02,0x02,0xFE,0x02,0x02,0x02,0x02,0x02,0xFE,0x00,0x00,0x00 },
  189.   { 0x40,0x40,0x40,0x40,0x40,0x40,0x7F,0x40,0x40,0x40,0x41,0x42,0x41,0x40,0x40,0x00 },/*"卫",5*/

  190.   { 0x08,0x06,0x22,0x22,0xA2,0x62,0x3A,0xA2,0x22,0x22,0x22,0x22,0x22,0x0A,0x06,0x00 },
  191.   { 0x10,0x10,0x12,0x13,0x12,0x12,0x12,0xFF,0x12,0x12,0x12,0x12,0x12,0x10,0x10,0x00 },/*"军",6*/


  192. };
复制代码

效果图:

效果图 由于限制 无法上传高清图

效果图 由于限制 无法上传高清图

STM32_ARDUINO_OLED.zip

10.87 KB, 下载次数: 63

库文件

回复

使用道具 举报

发表于 2017-8-20 15:41:14 | 显示全部楼层
谢谢分享。无量功德。
回复 支持 反对

使用道具 举报

发表于 2017-8-21 00:03:34 | 显示全部楼层
不错,谢谢分享,不过没找到附件。

另外,这个屏是什么驱动芯片的?1306的有对应的arduino库Adafruit_SSD1306-master,我一直用的好好的。只是这个库有点大,我都是阉割了用的。
回复 支持 反对

使用道具 举报

发表于 2017-8-21 08:26:13 | 显示全部楼层
有没有180度旋转的命令?因为有时候硬件摆放方向不是自己期望的方向。

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

这个库中没有,您这个库里有吗?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2017-8-24 01:52:33 | 显示全部楼层
哎呀,竟然忘记上传库文件了
回复 支持 反对

使用道具 举报

 楼主| 发表于 2017-8-24 16:32:45 | 显示全部楼层
老胖熊 发表于 2017-8-21 00:03
不错,谢谢分享,不过没找到附件。

另外,这个屏是什么驱动芯片的?1306的有对应的arduino库Adafruit_SS ...

那天忘记上传附件,现在已经上传了。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2017-8-24 16:39:03 | 显示全部楼层
wetnt 发表于 2017-8-21 08:26
有没有180度旋转的命令?因为有时候硬件摆放方向不是自己期望的方向。

#include

没有180翻转,我只是移植了基础部分。想要翻转或更多功能可以使用U8G,那也很方便的。
回复 支持 反对

使用道具 举报

发表于 2017-9-10 10:13:33 | 显示全部楼层
ARDUINO 直接用U8GLIB库,有1306,也可以180度
回复 支持 反对

使用道具 举报

发表于 2017-10-18 20:54:46 | 显示全部楼层
oled.OLED_ShowCHinese(0,0,0);
我问一下括号里的参数分别是什么,O(∩_∩)O谢谢
回复 支持 反对

使用道具 举报

高级模式  
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|联系我们|极客工坊 ( 浙ICP备09023225号 )

GMT+8, 2017-11-25 13:43 , Processed in 0.048507 second(s), 6 queries , File On.

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表