用户工具

站点工具


ocrobot:peripheral_module:bicolor_led:main

8x8双色点阵

8×8 I2C点阵(红绿双色)模块是一个基于I2C通讯协议的8×8点阵LED显示器,采用Adafruit LED驱动库解决方案驱动

驱动

arduino驱动库下地址:

Adafruit-LED-Backpack-Library(I2C驱动库)

Adafruit-GFX-Library (标准图形库)

以上库文件需放到<你的arduino主目录>/libraries/下

此库适用于目前1.04及以前版本(不低于1.0版本),更新的兼容性请关注github跟新信息

该项目github托管地址分别

https://github.com/adafruit/Adafruit-LED-Backpack-Library

https://github.com/adafruit/Adafruit-GFX-Library


I2C地址位

模块后有A0 A1 A2三个空焊盘 断开为零 短接为1

A0 A1 A2 地址码
0000x70
1000x71
0100x72
1100x73
0010x74
1010x75
0110x76
1110x77

特点

  • 四个M2.5螺丝孔
  • 平面外壳固定设计
  • PH2.0防呆接口

参数

< 30% 20% 80% >
33.02mm(1300mil)
33.02mm(1300mil)

参考图片

示例程序

用点阵显示一只动物头像

#include <Wire.h>
#include "Adafruit_LEDBackpack.h"
#include "Adafruit_GFX.h"
 
Adafruit_BicolorMatrix matrix = Adafruit_BicolorMatrix();
void setup() {
  Serial.begin(9600);
  Serial.println("8x8 LED Matrix Test");
 
  matrix.begin(0x70);  // pass in the address
}
 
static const uint8_t PROGMEM
smile_bmp[] =
{ 
  B01100110,
  B01100110,
  B01111110,
  B10000001,
  B10000001,
  B10000001,
  B01000010,
  B00100100 }
,
s_bmp[] =
{ 
  B00000000,
  B00000000,
  B00000000,
  B00000000,
  B00000000,
  B00000000,
  B00011000,
  B00000000 }
,
neutral_bmp[] =
{ 
  B00000000,
  B00000000,
  B00000000,
  B00000000,
  B00100100,
  B00000000,
  B00000000,
  B00000000  }
;
void loop() {
 // matrix.clear();                                     //清空屏幕
  matrix.setRotation(3);                                //设置矩阵
  matrix.drawBitmap(0, 0, smile_bmp, 8, 8, LED_RED);   //描绘形状与设置颜色,(行起始,列起始;矩阵设置;行数,列数;颜色)
  matrix.writeDisplay();                              //渲染上点阵
                                //时间间隔
 
  matrix.setRotation(3); 
  matrix.drawBitmap(0, 0,s_bmp, 8, 8, LED_YELLOW);
  matrix.writeDisplay();
 
  matrix.setRotation(3); 
  matrix.drawBitmap(0, 0, neutral_bmp, 8, 8, LED_GREEN);
  matrix.writeDisplay();
  delay(500);
 
}

下载

数据手册: 原理图:

ocrobot/peripheral_module/bicolor_led/main.txt · 最后更改: 2023/06/07 04:23 由 127.0.0.1

Valid HTML5 Valid CSS Driven by DokuWiki