设为首页收藏本站

极客工坊

 找回密码
 注册

只需一步,快速开始

查看: 893|回复: 8

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

  [复制链接]
发表于 2017-8-19 23:09:06 | 显示全部楼层 |阅读模式
本帖最后由 小学徒 于 2017-8-24 01:54 编辑

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

}

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

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

unsigned char BMP1[] =
{
  //个性签名:韦卫军  
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0xC0,0x70,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x30,0x10,0xF8,0x0E,0x09,0x04,0x05,0xFE,0x86,0xE2,0x9E,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x40,0x60,0x20,0x20,0x10,0x18,
  0x18,0x08,0x04,0x06,0x02,0x02,0x02,0x01,0x01,0x01,0x01,0x03,0x02,0x0C,0xF0,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x70,0xF8,0x60,0x20,
  0x20,0x20,0x10,0x10,0x10,0x10,0x10,0x18,0x18,0x08,0x08,0x08,0x00,0x08,0x04,0x86,
  0x82,0x82,0x02,0x02,0x02,0x02,0x82,0x62,0x12,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x80,0xFF,0xC2,0x41,0xA1,0xFF,0x88,0x44,0x42,0x41,0x40,0x40,0x40,0x40,0xC0,
  0x40,0x70,0x58,0x48,0x44,0x44,0x44,0x42,0x41,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
  0xDF,0x11,0x21,0x22,0x24,0x38,0xE0,0x20,0x20,0x20,0x10,0x18,0x10,0x07,0x01,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x80,0x80,
  0x80,0x80,0xC0,0xC0,0xC0,0xA0,0xE0,0xA0,0xA0,0xA0,0x90,0x90,0xD0,0x7F,0x4D,0x2C,
  0x14,0x17,0x1F,0x02,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x20,0x20,0x30,0x38,0x10,0x18,0x14,0x0C,0x1C,0x0A,0x06,0x06,0x06,0x02,0x01,0x03,
  0x01,0x01,0xFF,0x00,0xF5,0x0F,0x01,0x80,0x40,0x20,0x10,0x0C,0x03,0x01,0x01,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x40,0x40,0x70,0x18,0x04,0x02,
  0x01,0x00,0x00,0x00,0xC0,0x38,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x01,0x01,
  0x01,0x01,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x1F,0x00,0x00,0x00,
  0x00,0x00,0x00,0x80,0x00,0x80,0x80,0x80,0x80,0x80,0x40,0x40,0x40,0x40,0x40,0x40,
  0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x1F,0x1E,0x31,0x24,0x27,0x21,0x20,0x20,0x20,0x20,0x10,0x10,0x10,0x10,
  0x10,0x08,0x04,0x04,0x04,0x02,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x0E,0x0A,0x09,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,
  0x08,0x08,0x08,0x08,0x08,0x08,0x04,0x04,0x04,0x02,0x01,0x01,0x01,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x70,0xD8,0x04,0x04,0x02,0x02,0x03,0x7F,0x83,0x01,0x01,
  0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x02,0x04,0x08,0x18,0x10,0x10,0x23,0x3C,0x30,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x18,0x28,0xC8,0x08,0x08,0x08,
  0x08,0x04,0x04,0x02,0x01,0x02,0x04,0x04,0x08,0x08,0x08,0x08,0xC8,0x28,0x18,0x08,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x08,0x18,0x28,0xC8,0xC8,0x08,0x08,0x08,0x08,0x0C,0x04,0x03,0x01,0x01,0x02,
  0x04,0x08,0x08,0x08,0x08,0x08,0x48,0xC8,0x38,0x18,0x08,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x08,0x98,0x78,0x08,0x08,0x08,0x0C,0x04,
  0x04,0x02,0x01,0x01,0x03,0x04,0x04,0x08,0x08,0x08,0x08,0x68,0x98,0x88,0x08,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x07,0x05,0x05,0x04,0x04,0x04,
  0x04,0x08,0x08,0x10,0x30,0x10,0x08,0x08,0x04,0x04,0x04,0x04,0x05,0x05,0x07,0x04,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x04,0x07,0x05,0x05,0x04,0x04,0x04,0x04,0x04,0x04,0x08,0x10,0x20,0x20,0x10,
  0x18,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x05,0x06,0x04,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,
  0x02,0x04,0x0C,0x08,0x04,0x02,0x03,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};
unsigned char BMP2[] =
{
  0x00,0x06,0x0A,0xFE,0x0A,0xC6,0x00,0xE0,0x00,0xF0,0x00,0xF8,0x00,0x00,0x00,0x00,
  0x00,0x00,0xFE,0x7D,0xBB,0xC7,0xEF,0xEF,0xEF,0xEF,0xEF,0xEF,0xEF,0xC7,0xBB,0x7D,
  0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,
  0x0C,0xFE,0xFE,0x0C,0x08,0x20,0x60,0xFE,0xFE,0x60,0x20,0x00,0x00,0x00,0x78,0x48,
  0xFE,0x82,0xBA,0xBA,0x82,0xBA,0xBA,0x82,0xBA,0xBA,0x82,0xBA,0xBA,0x82,0xFE,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFF,
  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0xFF,0xFF,0x00,0x00,0xFE,0xFF,0x03,
  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0xFF,0xFE,0x00,0x00,0x00,0x00,0xC0,0xC0,
  0xC0,0x00,0x00,0x00,0x00,0xFE,0xFF,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
  0xFF,0xFE,0x00,0x00,0xFE,0xFF,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0xFF,
  0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0xFF,0xFF,0x0C,
  0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0xFF,0xFF,0x00,0x00,0x00,0x00,0xE1,0xE1,
  0xE1,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0xFF,0xFF,0x00,0x00,0xFF,0xFF,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0xFF,
  0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x1F,
  0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x0F,0x00,0x00,0x0F,0x1F,0x18,
  0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x0F,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
  0x1F,0x0F,0x00,0x00,0x0F,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,
  0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x8C,0x42,0x22,0x12,0x0C,0x00,0xFC,0x02,0x02,0x02,0xFC,0x00,0x00,0x04,
  0xFE,0x00,0x00,0x00,0x20,0x58,0x44,0xFE,0x40,0x00,0x10,0x10,0x10,0x10,0x10,0x00,
  0x00,0x04,0xFE,0x00,0x00,0x00,0xFC,0x02,0x02,0x02,0xFC,0x00,0x10,0x10,0x10,0x10,
  0x10,0x00,0xFC,0x02,0x02,0x02,0xFC,0x00,0x00,0x04,0xFE,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x24,0xA4,0x2E,0x24,0xE4,0x24,0x2E,0xA4,0x24,0x00,0x00,0x00,0xF8,0x4A,0x4C,
  0x48,0xF8,0x48,0x4C,0x4A,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x01,0x01,0x01,0x00,0x00,0x00,0x01,
  0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x01,0x01,0x01,0x00,0x00,0x00,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x01,0x01,0x01,0x00,0x00,0x00,0x01,0x01,0x01,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x20,0x10,0x10,
  0x10,0x10,0x20,0xC0,0x00,0x00,0xC0,0x20,0x10,0x10,0x10,0x10,0x20,0xC0,0x00,0x00,
  0x00,0x12,0x0A,0x07,0x02,0x7F,0x02,0x07,0x0A,0x12,0x00,0x00,0x00,0x0B,0x0A,0x0A,
  0x0A,0x7F,0x0A,0x0A,0x0A,0x0B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x20,0x40,0x40,
  0x40,0x50,0x20,0x5F,0x80,0x00,0x1F,0x20,0x40,0x40,0x40,0x50,0x20,0x5F,0x80,0x00

};
/************************************ino3*********************************************/
char Hzk[][32] = {

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

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

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

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

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

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

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


};
效果图:

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

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

STM32_ARDUINO_OLED.zip

10.87 KB, 下载次数: 0

库文件

回复

使用道具 举报

发表于 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度
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2017-9-23 04:40 , Processed in 0.052558 second(s), 10 queries , File On.

Powered by Discuz! X3.3 Licensed

© 2001-2017 Comsenz Inc.

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