pdf-icon

Unit OLED

SKU:U119

描述

Unit OLED 是一款 1.3 英寸的 OLED 拓展屏幕单元。采用 SH1107 驱动方案,支持黑 / 白显示,分辨率为 128 x 64。驱动芯片选用 I2C 通信接口,使用时用户能够将其挂载到现有设备的 I2C 总线中,起到节省 IO 的作用。屏幕背部集成了磁吸设计,能够轻松吸附金属表面进行固定。该 OLED 屏幕拓展适合嵌入到各种需要显示简单内容的仪器仪表或是控制设备中作为显示面板。

产品特性

  • OLED显示面板
  • SH1107驱动方案
  • 显示颜色:黑/白
  • I2C通信接口
  • 128 x 64分辨率
  • 可视角: 全视角
  • 背部磁吸设计

包含

  • 1 x Unit OLED
  • 1 x HY2.0-4P Grove 连接线 (20cm)

应用

  • 信息显示屏

规格参数

规格 参数
工作电流 58mA
通信接口 I2C address: 0x3C
显示尺寸 14.7 × 29.42mm
像素间距 0.17×0.17mm
像素尺寸 0.15×0.15mm
可视角 全视角
工作温度 0°C to 60°C
净重 9.3g
毛重 20g
产品尺寸 24 x 56 x 8mm
包装尺寸 67 x 53 x 12mm
外壳材质 Plastic (PC)

原理图

管脚映射

M5Core (PORT A) G22 G21 5V GND
Unit OLED SCL SDA 5V GND

尺寸图

数据手册

软件开发


#include <M5UnitOLED.h>

//M5UnitOLED display ( 21, 22, 400000 ); // SDA, SCL, FREQ
M5UnitOLED display; // default setting

M5Canvas canvas(&display);

static constexpr char text[] = "Hello world ! こんにちは世界! this is long long string sample. 寿限無、寿限無、五劫の擦り切れ、海砂利水魚の、水行末・雲来末・風来末、喰う寝る処に住む処、藪ら柑子の藪柑子、パイポ・パイポ・パイポのシューリンガン、シューリンガンのグーリンダイ、グーリンダイのポンポコピーのポンポコナの、長久命の長助";
static constexpr size_t textlen = sizeof(text) / sizeof(text[0]);
int textpos = 0;
int scrollstep = 2;

void setup(void) 
{
  display.init();
  display.setRotation(2);
  canvas.setColorDepth(1); // mono color
  canvas.setFont(&fonts::lgfxJapanMinchoP_32);
  canvas.setTextWrap(false);
  canvas.setTextSize(2);
  canvas.createSprite(display.width() + 64, 72);
}

void loop(void)
{
  int32_t cursor_x = canvas.getCursorX()-scrollstep;
  if (cursor_x <= 0)
  {
    textpos = 0;
    cursor_x = display.width();
  }

  canvas.setCursor(cursor_x, 0);
  canvas.scroll(-scrollstep, 0);
  while (textpos < textlen && cursor_x <= display.width())
  {
    canvas.print(text[textpos++]);
    cursor_x = canvas.getCursorX();
  }
  display.waitDisplay();
  canvas.pushSprite(&display, 0, (display.height()-canvas.height()) >> 1);
}

UIFlow 1.0

相关视频

  • UIFlow2.0 OLED Unit