gada888 发表于 2019-1-14 20:44:16

点亮一个IIC的8x8点阵模块

大家好,今天给大家介绍怎么点亮一个IIC的点阵。平常大家见的最多的是MAX7219点阵模块。相比较而言,IIC的点阵更方便。下面给大家介绍的是合泰的16k33点阵驱动模块和arduino UNO连接后。点亮一个8x8的点阵。


下面是合泰的点阵驱动

下面是连线图

因为是IIC的驱动,因此只需要连4根线。SDA-A4.SCL-A5。VCC-VCC,GND-GND

#include <Wire.h>
#include <Adafruit_GFX.h>
#include "Adafruit_LEDBackpack.h"
Adafruit_8x8matrix matrix = Adafruit_8x8matrix();
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[] =
{ B00111100,
B01000010,
B10100101,
B10000001,
B10100101,
B10011001,
B01000010,
B00111100 },
frown_bmp[] =
{ B00111100,
B01000010,
B10100101,
B10000001,
B10011001,
B10100101,
B01000010,
B00111100 };
void loop() {
matrix.clear();
matrix.drawBitmap(0, 0, smile_bmp, 8, 8, LED_ON);
matrix.writeDisplay();
delay(1000);
matrix.clear();
matrix.drawBitmap(0, 0, frown_bmp, 8, 8, LED_ON);
matrix.writeDisplay();
delay(1000);
matrix.clear(); // clear display

matrix.setTextSize(1);
matrix.setTextWrap(false); // we dont want text to wrap so it scrolls nicely
matrix.setTextColor(LED_ON);
for (int8_t x=0; x>=-36; x--) {
matrix.clear();
matrix.setCursor(x,0);
matrix.print("GADA888");
matrix.writeDisplay();
delay(100);
}
matrix.setRotation(2);
for (int8_t x=7; x>=-36; x--) {
matrix.clear();
matrix.setCursor(x,0);
matrix.print("GADA888");
matrix.writeDisplay();
delay(100);
}
matrix.setRotation(0);
}


记得加入运行库
https://v.youku.com/v_show/id_XNDAxMjk0NTMxNg==.html?spm=a2h3j.8428770.3416059.1

gray6666 发表于 2019-1-15 08:48:50

学习了,感谢。。。。。。。

rzegkly 发表于 2019-1-16 17:27:01

8*8点阵模块用bit可以点亮?
页: [1]
查看完整版本: 点亮一个IIC的8x8点阵模块