Wemos LED matrix shield examples

In this article we will look at the wemos matrix shield, we will have numerous examples using the Arduino IDE

64

In this article we will look at the wemos matrix shield, we will have numerous examples using the Arduino IDE

The shield is an 8×8 LED matrix, this matrix is controlled by a TM1640.  The TM1640 is a LED (Light Emitting Diode Display) drive control circuit integrating MCU digital interface, digital latch, LED high voltage drive circuit, etc

You can control the intensity of the LEDs quite easily

This is what the shield looks like

matrix led shield
matrix led shield

The following pins are used by the shield so will be unavailable for other devices

D1 miniShield
D5CLK
D7DIN

 

Code Examples

You need to install the Matrix LED Shield Arduino Library

Example 1

//breathing matrix ???
#include <WEMOS_Matrix_LED.h>
MLED mled(0); //set intensity=0
void setup()
{
Serial.begin(115200);
for(int i=0; i<8; i++)
{
mled.disBuffer[i]=0xff; //full screen
}
}
void loop()
{
for(int i=0;i<8;i++)
{
mled.intensity=i;//change intensity
mled.display();
delay(100);
}
}

 

Example 2

//draw and clear dot
#include <WEMOS_Matrix_LED.h>
MLED mled(5); //set intensity=5
void setup()
{
}
void loop()
{
for(int y=0;y<8;y++)
{
for(int x=0;x<8;x++)
{
mled.dot(x,y); // draw dot
mled.display();
delay(200);
mled.dot(x,y,0);//clear dot
mled.display();
delay(200);
}
}
}

 

Example 3

//random dot
#include <WEMOS_Matrix_LED.h>
MLED mled(5); //set intensity=5
long randX;
long randY;
void setup()
{
Serial.begin(9600);
randomSeed(analogRead(A0));
}
void loop()
{
randX = random(0, 8);
randY = random(0, 8);
mled.dot(randX,randY); // draw dot
mled.display();
delay(200);
mled.dot(randX,randY,0);//clear dot
mled.display();
delay(200);
}

 

Example 4

#include <WEMOS_Matrix_LED.h>
MLED mled(5); //set intensity=5
void setup()
{
}
void loop()
{
for(int y=0;y<8;y++)
{
mled.dot(3,y); // draw dot
mled.dot(4,y); // draw dot
mled.display();
}
}

 

Example 5

#include <WEMOS_Matrix_LED.h>
MLED mled(5); //set intensity=5
void setup()
{
}
void loop()
{
for(int x=0;x<8;x++)
{
mled.dot(x,3); // draw dot
mled.dot(x,4); // draw dot
mled.display();
}
}

 

Example 6

//box
#include <WEMOS_Matrix_LED.h>
MLED mled(5); //set intensity=5
void setup()
{
}
void loop()
{
for(int x=0;x<8;x++)
{
mled.dot(x,0); // draw dot
mled.dot(x,7); // draw dot
mled.display();
}
for(int y=0;y<8;y++)
{
mled.dot(0,y); // draw dot
mled.dot(7,y); // draw dot
mled.display();
}
}

 

Example 7

#include <WEMOS_Matrix_LED.h>
MLED mled(5); //set intensity=5
void setup()
{
}
void loop()
{
for(int x=0;x<8;x++)
{
mled.dot(x,0); // draw dot
mled.dot(x,7); // draw dot
mled.display();
}
for(int y=0;y<8;y++)
{
mled.dot(0,y); // draw dot
mled.dot(7,y); // draw dot
mled.display();
}
//lets draw a dot in the middle easy way
mled.dot(3,3); // draw dot
mled.dot(3,4); // draw dot
mled.dot(4,3); // draw dot
mled.dot(4,4); // draw dot
}

 

Example 8

#include <WEMOS_Matrix_LED.h>
MLED mled(5); //set intensity=5
void setup()
{
}
void loop()
{
//outside lines
for(int x=0;x<8;x++)
{
mled.dot(x,0); // draw dot
mled.dot(x,7); // draw dot
mled.display();
}
for(int y=0;y<8;y++)
{
mled.dot(0,y); // draw dot
mled.dot(7,y); // draw dot
mled.display();
}
//inside lines
delay(500);
for(int x=1;x<7;x++)
{
mled.dot(x,1); // draw dot
mled.dot(x,6); // draw dot
mled.display();
}
for(int y=1;y<7;y++)
{
mled.dot(1,y); // draw dot
mled.dot(6,y); // draw dot
mled.display();
}
//inside lines 2
delay(500);
for(int x=2;x<6;x++)
{
mled.dot(x,2); // draw dot
mled.dot(x,5); // draw dot
mled.display();
}
for(int y=2;y<6;y++)
{
mled.dot(2,y); // draw dot
mled.dot(5,y); // draw dot
mled.display();
}
delay(500);
//lets draw a dot in the middle easy way
mled.dot(3,3); // draw dot
mled.dot(3,4); // draw dot
mled.dot(4,3); // draw dot
mled.dot(4,4); // draw dot
mled.display();
delay(2000);
for(int y=0;y<8;y++)
{
for(int x=0;x<8;x++)
{
mled.dot(x,y,0);//clear dot
mled.display();
}
}
}

 

Video

This is a video of the examples above

Links

 

Matrix LED Shield V1.0.0 8 Step Adjustable Intensity for WEMOS D1 mini V1.0 8×8

You might also like More from author

Comments are closed, but trackbacks and pingbacks are open.