用户工具

站点工具


ocrobot:peripheral_module:oled12864:main

0.96寸OLED 12864液晶显示模块

简介

特点

参数

本模块为IIC通讯方式,默认配一根双端子线,绿色为SDA,黄色为SCL,黑色GND,红色5V

参考图片

示例程序

/*
使用u8g2显示图片,图片已经取模成数组
图形显示器:OpenJumper 12864 OLED
设备核心:SSD1306
*/
 
#include <U8g2lib.h>
 
#define rst  2
U8G2_SSD1306_128X64_NONAME_F_HW_I2C  u8g2(U8G2_R0 , rst);
 
//取模得到的数组
 
 
 
 
const unsigned char col[] U8X8_PROGMEM= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xbf,0x3f,0x00,0x00,0x00,0xc0,0x3f,0x70,0x00,0x80,0xc3,0x3f,0x00,0x20,0x00,0x0f,0x00,0x00,0x1c,0x40,0x00,0x10,0x00,0x01,0x00,0x00,0x20,0x80,0x00,0x10,0xc0,0x01,0x01,0x10,0x40,0x80,0x00,0x10,0x70,0x00,0x01,0x00,0x80,0x81,0x00,0x10,0x08,0x00,0x00,0x00,0x00,0x82,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x84,0x00,0x20,0x02,0x00,0x00,0x00,0x00,0x08,0x00,0x20,0x01,0x00,0x00,0x00,0x00,0x48,0x00,0x20,0x00,0x20,0x00,0x80,0x00,0x50,0x00,0xc0,0x00,0x10,0x00,0x00,0x00,0x20,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x40,0x04,0x40,0x00,0x20,0x00,0x04,0x00,0x20,0x00,0x00,0x40,0x20,0x00,0x40,0x00,0x20,0x00,0x80,0xb0,0x10,0x00,0x40,0x00,0x00,0x00,0x00,0x0e,0x07,0x00,0x80,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x30,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0xc0,0x70,0x03,0x00,0x30,0x00,0x00,0x00,0x00,0x0f,0x04,0x00,0x06,0x00,0x00,0x00,0x00,0x02,0x08,0xf8,0x01,0x00,0x00,0x00,0x00,0x02,0xf8,0x7f,0x07,0x00,0x00,0x00,0x00,0x00,0xfc,0x0f,0x04,0x00,0x00,0x00,0x00,0x04,0x14,0x02,0x08,0x00,0x00,0x00,0x00,0x08,0x03,0x02,0x06,0x00,0x00,0x00,0x00,0xf0,0x08,0x84,0x03,0x00,0x00,0x00,0x00,0x80,0xf0,0x46,0x00,0x00,0x00,0x00,0x00,0x74,0x10,0xc2,0x08,0x00,0x00,0x00,0x00,0x44,0xc0,0x01,0x0e,0x00,0x00,0x00,0x00,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x18,0x03,0x00,0x00,0x00,0x00,0x00,0x40,0x08,0x44,0x00,0x00,0x00,0x00,0x00,0x80,0x06,0x58,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; 
void setup(void) {
  u8g2.begin();
}
 
void loop(void) {
  u8g2.clearBuffer();           // 清空显示设备内部缓冲区
  u8g2.drawXBMP( 0 , 0 , 60 , 64 , col );     //50,50为图片尺寸,根据你的图片尺寸修改
  u8g2.sendBuffer();         // 显示缓冲区内容
  delay(1000);  
}

下载

数据手册: 原理图:

ocrobot/peripheral_module/oled12864/main.txt · 最后更改: 2019/03/20 07:25 由 董凯萍