Difference between revisions of "Grove-Red LED Matrix w Driver"
(→Matériel Compatible) |
(→display_number.ino) |
||
| (23 intermediate revisions by the same user not shown) | |||
| Line 2: | Line 2: | ||
=== Caractéristiques === | === Caractéristiques === | ||
Interface I2c<br> | Interface I2c<br> | ||
| − | Adresse I2C : 0x70 (par défaut) | + | Adresse I2C : '''0x70''' (par défaut) |
=== Images === | === Images === | ||
| Line 9: | Line 9: | ||
[[File:Grove-Red LED Matrix pinout.jpg | 400px]] | [[File:Grove-Red LED Matrix pinout.jpg | 400px]] | ||
| − | [[File:WithGrove-Red LED Matrix connect.jpeg | | + | [[File:WithGrove-Red LED Matrix connect.jpeg | 600px]] |
=== Drivers === | === Drivers === | ||
| Line 39: | Line 39: | ||
=== Code === | === Code === | ||
| − | + | === display_bars.ino === | |
| − | + | <pre> | |
| − | + | #include <Wire.h> | |
| + | #include "Grove_LED_Matrix_Driver_HT16K33.h" | ||
| + | Matrix_8x8 matrix; | ||
| − | + | void setup() | |
| + | { | ||
| + | Wire.begin(); | ||
| + | matrix.init(); | ||
| + | matrix.setBrightness(0); | ||
| + | matrix.setBlinkRate(BLINK_OFF); | ||
| + | } | ||
| − | + | void loop() | |
| − | + | { | |
| − | + | for (int i=0;i<33;i++) | |
| − | + | { | |
| − | + | // The input range of writeBar is [0-32] | |
| − | + | matrix.writeBar(i); | |
| − | + | matrix.display(); | |
| + | delay(150); | ||
| + | } | ||
| + | } | ||
| + | </pre> | ||
| − | + | === display_number.ino === | |
| − | + | <pre> | |
| − | + | #include <Wire.h> | |
| − | + | #include "Grove_LED_Matrix_Driver_HT16K33.h" | |
| − | + | ||
| − | + | Matrix_8x8 matrix; | |
| − | + | ||
| − | + | void setup() { | |
| − | + | Wire.begin(); | |
| − | + | matrix.init(); | |
| − | + | matrix.setBrightness(0); | |
| + | matrix.setBlinkRate(BLINK_OFF); | ||
| + | } | ||
| + | |||
| + | void loop() { | ||
| + | // display number "0" and delay 800ns | ||
| + | matrix.writeNumber(0, 800); | ||
| + | matrix.display(); | ||
| + | |||
| + | // display number "-2147483648" and delay (800*11)ns | ||
| + | // the display range of writeNumber() is int32_t (from -2147483648 to 2147483647) | ||
| + | matrix.writeNumber(-2147483648, 800); | ||
| + | matrix.display(); | ||
| + | } | ||
| + | </pre> | ||
| + | |||
| + | === LED_Matrix_Editor_Emoji.ino === | ||
| + | <pre> | ||
| + | #include "Grove_LED_Matrix_Driver_HT16K33.h" | ||
| + | #include <Wire.h> | ||
| + | |||
| + | //put your own design hex group here. | ||
| + | const uint64_t Emoji[] = | ||
| + | { | ||
| + | 0x3c4299a581a5423c, | ||
| + | 0x3c4281bd81a5423c, | ||
| + | 0x3c42a59981a5423c, | ||
| + | }; | ||
| + | |||
| + | Matrix_8x8 matrix; | ||
| + | |||
| + | void setup() { | ||
| + | Wire.begin(); | ||
| + | matrix.init(); | ||
| + | matrix.setBrightness(0); | ||
| + | matrix.setBlinkRate(BLINK_OFF); | ||
| + | } | ||
| + | |||
| + | void loop() { | ||
| + | for (int i = 0;i < 3;i++) | ||
| + | { | ||
| + | matrix.writeOnePicture(Emoji[i]); | ||
| + | matrix.display(); | ||
| + | delay(500); | ||
| + | } | ||
| + | } | ||
| + | </pre> | ||
| + | |||
| + | === LED_Matrix_Editor_Display_Numbers.ino === | ||
| + | <pre> | ||
| + | #include "Grove_LED_Matrix_Driver_HT16K33.h" | ||
| + | #include <Wire.h> | ||
| + | |||
| + | //put your own design hex group here. | ||
| + | const uint64_t Emoji[] = | ||
| + | { | ||
| + | 0x1c08080808080c08, // 1 | ||
| + | 0x3e0408102020221c, // 2 | ||
| + | 0x1c2220201820221c, // 3 | ||
| + | 0x20203e2224283020, // 4 | ||
| + | 0x1c2220201e02023e, // 5 | ||
| + | 0x1c2222221e02221c, // 6 | ||
| + | 0x040404081020203e, // 7 | ||
| + | 0x1c2222221c22221c, // 8 | ||
| + | 0x1c22203c2222221c, // 9 | ||
| + | 0x1c2222222222221c, // 0 | ||
| + | }; | ||
| + | |||
| + | Matrix_8x8 matrix; | ||
| + | |||
| + | void setup() { | ||
| + | Wire.begin(); | ||
| + | matrix.init(); | ||
| + | matrix.setBrightness(0); | ||
| + | matrix.setBlinkRate(BLINK_OFF); | ||
| + | } | ||
| + | |||
| + | void loop() { | ||
| + | for (int i = 0;i < 10;i++) | ||
| + | { | ||
| + | matrix.writeOnePicture(Emoji[i]); | ||
| + | matrix.display(); | ||
| + | delay(4000); | ||
| + | } | ||
| + | } | ||
| + | </pre> | ||
| + | |||
| + | === Numbers & symboles === | ||
| + | [http://xantorohara.github.io/led-matrix-editor/# xantorohara.github.io/led-matrix-editor/#]LED Matrix Editor | ||
| + | |||
| + | |||
| + | <pre> | ||
| + | const uint64_t IMAGES[] = { | ||
| + | 0x000c0c00000c0c00, //: | ||
| + | 0x000c0c0000000000, //. | ||
| + | 0x0036367f367f3636, //# | ||
| + | 0x0000663cff3c6600 //* | ||
| + | }; | ||
| + | const int IMAGES_LEN = sizeof(IMAGES)/8; | ||
| + | </pre> | ||
=== Matériel Compatible === | === Matériel Compatible === | ||
Seeeduino Cortex-M0+<br> | Seeeduino Cortex-M0+<br> | ||
Arduino UNO REV3 | Arduino UNO REV3 | ||
Latest revision as of 23:14, 5 April 2020
Contents
Grove-Red_LED_Matrix_w_Driver
Caractéristiques
Interface I2c
Adresse I2C : 0x70 (par défaut)
Images
Drivers
HT16K33
Voltage
Tension d'alimentation 3,3 V / 5 V
Librairie
Wire.h (arduino)
Grove_LED_Matrix_Driver_HT16K33.h
github.com/Seeed-Studio/Grove_LED_Matrix_Driver_HT16K33 github
github.com/Seeed-Studio/Grove_LED_Matrix_Driver_HT16K33/archive/master.zip ZIP
Liste des Exemples
display_bars
display_cutsom_pictures
display_icon
display_number
display_string
offset_and_rotate
Liens Externes
wiki.seeedstudio.com/Grove-Red_LED_Matrix_w_Driver wiki
Code
display_bars.ino
#include <Wire.h>
#include "Grove_LED_Matrix_Driver_HT16K33.h"
Matrix_8x8 matrix;
void setup()
{
Wire.begin();
matrix.init();
matrix.setBrightness(0);
matrix.setBlinkRate(BLINK_OFF);
}
void loop()
{
for (int i=0;i<33;i++)
{
// The input range of writeBar is [0-32]
matrix.writeBar(i);
matrix.display();
delay(150);
}
}
display_number.ino
#include <Wire.h>
#include "Grove_LED_Matrix_Driver_HT16K33.h"
Matrix_8x8 matrix;
void setup() {
Wire.begin();
matrix.init();
matrix.setBrightness(0);
matrix.setBlinkRate(BLINK_OFF);
}
void loop() {
// display number "0" and delay 800ns
matrix.writeNumber(0, 800);
matrix.display();
// display number "-2147483648" and delay (800*11)ns
// the display range of writeNumber() is int32_t (from -2147483648 to 2147483647)
matrix.writeNumber(-2147483648, 800);
matrix.display();
}
LED_Matrix_Editor_Emoji.ino
#include "Grove_LED_Matrix_Driver_HT16K33.h"
#include <Wire.h>
//put your own design hex group here.
const uint64_t Emoji[] =
{
0x3c4299a581a5423c,
0x3c4281bd81a5423c,
0x3c42a59981a5423c,
};
Matrix_8x8 matrix;
void setup() {
Wire.begin();
matrix.init();
matrix.setBrightness(0);
matrix.setBlinkRate(BLINK_OFF);
}
void loop() {
for (int i = 0;i < 3;i++)
{
matrix.writeOnePicture(Emoji[i]);
matrix.display();
delay(500);
}
}
LED_Matrix_Editor_Display_Numbers.ino
#include "Grove_LED_Matrix_Driver_HT16K33.h"
#include <Wire.h>
//put your own design hex group here.
const uint64_t Emoji[] =
{
0x1c08080808080c08, // 1
0x3e0408102020221c, // 2
0x1c2220201820221c, // 3
0x20203e2224283020, // 4
0x1c2220201e02023e, // 5
0x1c2222221e02221c, // 6
0x040404081020203e, // 7
0x1c2222221c22221c, // 8
0x1c22203c2222221c, // 9
0x1c2222222222221c, // 0
};
Matrix_8x8 matrix;
void setup() {
Wire.begin();
matrix.init();
matrix.setBrightness(0);
matrix.setBlinkRate(BLINK_OFF);
}
void loop() {
for (int i = 0;i < 10;i++)
{
matrix.writeOnePicture(Emoji[i]);
matrix.display();
delay(4000);
}
}
Numbers & symboles
xantorohara.github.io/led-matrix-editor/#LED Matrix Editor
const uint64_t IMAGES[] = {
0x000c0c00000c0c00, //:
0x000c0c0000000000, //.
0x0036367f367f3636, //#
0x0000663cff3c6600 //*
};
const int IMAGES_LEN = sizeof(IMAGES)/8;
Matériel Compatible
Seeeduino Cortex-M0+
Arduino UNO REV3